mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Database: Modified ::lastLine to keep walking until it finds one
This commit is contained in:
parent
abb3fb79a3
commit
f52e6ea3aa
1 changed files with 6 additions and 1 deletions
|
@ -64,11 +64,16 @@ std::vector <std::string> Database::files () const
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Walk backwards through the files until an interval is found.
|
// Walk backwards through the files until an interval is found.
|
||||||
|
// Note: Not an exclusion.
|
||||||
std::string Database::lastLine ()
|
std::string Database::lastLine ()
|
||||||
{
|
{
|
||||||
std::vector <Datafile>::reverse_iterator ri;
|
std::vector <Datafile>::reverse_iterator ri;
|
||||||
for (ri = _files.rbegin (); ri != _files.rend (); ri++)
|
for (ri = _files.rbegin (); ri != _files.rend (); ri++)
|
||||||
return ri->lastLine ();
|
{
|
||||||
|
auto line = ri->lastLine ();
|
||||||
|
if (line != "")
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue