data: getLatestInterval always returns any open interval before a closed one

This commit is contained in:
Paul Beckingham 2016-05-03 07:10:41 -04:00
parent 945521712b
commit 3c8ebe976e

View file

@ -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);