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:
Shaun Ruffell 2019-12-02 21:55:45 -06:00 committed by lauft
parent 86bb1465e8
commit 9c0c27b55b

View file

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