diff --git a/src/helper.cpp b/src/helper.cpp index c426f26d..a1d4528a 100644 --- a/src/helper.cpp +++ b/src/helper.cpp @@ -73,7 +73,7 @@ Color tagColor (const Rules& rules, const std::string& tag) //////////////////////////////////////////////////////////////////////////////// // Summarize either an active or closed interval, for user feedback. std::string intervalSummarize ( - Database& database, + Database&, const Rules& rules, const Interval& interval) { @@ -81,26 +81,7 @@ std::string intervalSummarize ( if (interval.is_started ()) { - // Walk backwards through the inclusions, and stop as soon as the tags - // no longer match interval. This means the 'total' is the sum of all time - // in the most recent set of intervals for the same tags. This is the - // acceptable definition of "the current task". - time_t total_recorded = 0; - - for (auto& line : database) - { - Interval current = IntervalFactory::fromSerialization (line); - if (interval.tags () == current.tags ()) - { - total_recorded += current.total (); - } - else - { - break; - } - } - - Duration total (total_recorded); + Duration total (interval.total ()); // Combine and colorize tags. std::string tags;