From 958637e2ca76bd2548ffc5045a52fd4b06fc5690 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 28 Oct 2015 17:06:47 -0400 Subject: [PATCH] CmdBurndown: Removed unreachable code (completed/deleted tasks have no 'start' date) --- src/commands/CmdBurndown.cpp | 86 +++++++----------------------------- 1 file changed, 16 insertions(+), 70 deletions(-) diff --git a/src/commands/CmdBurndown.cpp b/src/commands/CmdBurndown.cpp index 4c738203f..3eda03e7d 100644 --- a/src/commands/CmdBurndown.cpp +++ b/src/commands/CmdBurndown.cpp @@ -293,51 +293,20 @@ void Chart::scan (std::vector & tasks) continue; } - if (task.has ("start")) + while (from < end) { - ISO8601d start = quantize (ISO8601d (task.get_date ("start"))); - while (from < start) - { - epoch = from.toEpoch (); - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._pending; - from = increment (from); - } - - while (from < end) - { - epoch = from.toEpoch (); - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._started; - from = increment (from); - } - - while (from < now) - { - epoch = from.toEpoch (); - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._done; - from = increment (from); - } + epoch = from.toEpoch (); + if (_bars.find (epoch) != _bars.end ()) + ++_bars[epoch]._pending; + from = increment (from); } - else - { - ISO8601d end = quantize (ISO8601d (task.get_date ("end"))); - while (from < end) - { - epoch = from.toEpoch (); - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._pending; - from = increment (from); - } - while (from < now) - { - epoch = from.toEpoch (); - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._done; - from = increment (from); - } + while (from < now) + { + epoch = from.toEpoch (); + if (_bars.find (epoch) != _bars.end ()) + ++_bars[epoch]._done; + from = increment (from); } } @@ -354,35 +323,12 @@ void Chart::scan (std::vector & tasks) if (end < _earliest) continue; - if (task.has ("start")) + while (from < end) { - ISO8601d start = quantize (ISO8601d (task.get_date ("start"))); - while (from < start) - { - epoch = from.toEpoch (); - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._pending; - from = increment (from); - } - - while (from < end) - { - epoch = from.toEpoch (); - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._started; - from = increment (from); - } - } - else - { - ISO8601d end = quantize (ISO8601d (task.get_date ("end"))); - while (from < end) - { - epoch = from.toEpoch (); - if (_bars.find (epoch) != _bars.end ()) - ++_bars[epoch]._pending; - from = increment (from); - } + epoch = from.toEpoch (); + if (_bars.find (epoch) != _bars.end ()) + ++_bars[epoch]._pending; + from = increment (from); } } }