mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Database: Modified ::getLatestInterval to walk backwards until one is found
This commit is contained in:
parent
db65ca2024
commit
71c6cd8026
1 changed files with 9 additions and 1 deletions
|
@ -87,7 +87,15 @@ std::vector <std::string> Database::files () const
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
Interval Database::getLatestInterval ()
|
Interval Database::getLatestInterval ()
|
||||||
{
|
{
|
||||||
return _files.back ().getLatestInterval ();
|
std::vector <Datafile>::reverse_iterator ri;
|
||||||
|
for (ri = _files.rbegin (); ri != _files.rend (); ri++)
|
||||||
|
{
|
||||||
|
auto i = ri->getLatestInterval ();
|
||||||
|
if (! i.empty ())
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Interval ();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue