From 9c0c27b55bebc0ecb4a659c87df7670fb8ab75ad Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 2 Dec 2019 21:55:45 -0600 Subject: [PATCH] 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. --- src/data.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/data.cpp b/src/data.cpp index 19f763f4..58cf8235 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -693,17 +693,6 @@ std::vector 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);