mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
getLatestInterval does not need to walk all the inclusions
This does not appear to be necessary anymore given that the database lines are generated from intervals and are all well formed. Any open interval *should* be at the end of the database. Related to issue #245.
This commit is contained in:
parent
86bb1465e8
commit
9c0c27b55b
1 changed files with 0 additions and 11 deletions
11
src/data.cpp
11
src/data.cpp
|
@ -693,17 +693,6 @@ std::vector <Range> getUntracked (
|
|||
Interval getLatestInterval (Database& database)
|
||||
{
|
||||
Interval i;
|
||||
for (auto& line : database.allLines ())
|
||||
{
|
||||
// inc YYYYMMDDTHHMMSSZ - YYYYMMDDTHHMMSSZ # ...
|
||||
// ^ 20
|
||||
if (line.find (" - ") != 20)
|
||||
{
|
||||
i = IntervalFactory::fromSerialization (line);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
auto lastLine = database.lastLine ();
|
||||
if (! lastLine.empty ())
|
||||
i = IntervalFactory::fromSerialization (lastLine);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue