mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
parent
8e20c48df4
commit
e2573d4516
1 changed files with 5 additions and 3 deletions
|
@ -195,6 +195,8 @@ Chart::~Chart ()
|
|||
void Chart::scanForPeak (std::vector <Task>& tasks)
|
||||
{
|
||||
std::map <time_t, int> pending;
|
||||
_current_count = 0;
|
||||
|
||||
for (auto& task : tasks)
|
||||
{
|
||||
// The entry date is when the counting starts.
|
||||
|
@ -203,6 +205,8 @@ void Chart::scanForPeak (std::vector <Task>& tasks)
|
|||
Datetime end;
|
||||
if (task.has ("end"))
|
||||
end = Datetime (task.get_date ("end"));
|
||||
else
|
||||
++_current_count;
|
||||
|
||||
while (entry < end)
|
||||
{
|
||||
|
@ -216,7 +220,7 @@ void Chart::scanForPeak (std::vector <Task>& tasks)
|
|||
}
|
||||
}
|
||||
|
||||
// Find the peak, peak date and current.
|
||||
// Find the peak and peak date.
|
||||
for (auto& count : pending)
|
||||
{
|
||||
if (count.second > _peak_count)
|
||||
|
@ -224,8 +228,6 @@ void Chart::scanForPeak (std::vector <Task>& tasks)
|
|||
_peak_count = count.second;
|
||||
_peak_epoch = count.first;
|
||||
}
|
||||
|
||||
_current_count = count.second;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue