mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Remove call to getAllInclusions when initializing tag database
This commit is contained in:
parent
cf8c35ad55
commit
e9f860d8ce
1 changed files with 7 additions and 6 deletions
|
@ -28,6 +28,7 @@
|
||||||
#include <Database.h>
|
#include <Database.h>
|
||||||
#include <format.h>
|
#include <format.h>
|
||||||
#include <JSON.h>
|
#include <JSON.h>
|
||||||
|
#include <IntervalFactory.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <shared.h>
|
#include <shared.h>
|
||||||
|
@ -443,17 +444,17 @@ void Database::initializeTagDatabase ()
|
||||||
|
|
||||||
if (!File::read (_location + "/tags.data", content))
|
if (!File::read (_location + "/tags.data", content))
|
||||||
{
|
{
|
||||||
auto intervals = getAllInclusions (*this);
|
auto it = rbegin ();
|
||||||
|
auto end = rend ();
|
||||||
|
|
||||||
if (intervals.empty ())
|
if (it == end)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "Tag info database does not exist. Recreating from interval data..." << std::endl ;
|
std::cout << "Tag info database does not exist. Recreating from interval data..." << std::endl ;
|
||||||
|
|
||||||
for (auto& interval : intervals)
|
for (; it != end; ++it)
|
||||||
{
|
{
|
||||||
|
Interval interval = IntervalFactory::fromSerialization (*it);
|
||||||
for (auto& tag : interval.tags ())
|
for (auto& tag : interval.tags ())
|
||||||
{
|
{
|
||||||
_tagInfoDatabase.incrementTag (tag);
|
_tagInfoDatabase.incrementTag (tag);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue