mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
data: getLatestInterval always returns any open interval before a closed one
This commit is contained in:
parent
945521712b
commit
3c8ebe976e
1 changed files with 9 additions and 0 deletions
|
@ -654,6 +654,15 @@ std::vector <Range> getUntrackedRanges (
|
|||
Interval getLatestInterval (Database& database)
|
||||
{
|
||||
Interval i;
|
||||
for (auto& line : database.allLines ())
|
||||
{
|
||||
if (line.find (" - ") == std::string::npos)
|
||||
{
|
||||
i.initialize (line);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
auto lastLine = database.lastLine ();
|
||||
if (lastLine != "")
|
||||
i.initialize (lastLine);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue