Skip to content

Commit

Permalink
Logic error in TaskLoop::RunIfNeeded()
Browse files Browse the repository at this point in the history
The ! operator would have priority over < and would transform currentTime before the
comparison. Moreso, the logic was reversed. It is supposed to return false if it's
not time yet to run the task, not the opposite.

CID 1273447.
  • Loading branch information
stpere committed Jul 1, 2015
1 parent 2bdea08 commit 93bd491
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kits/tracker/TaskLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ PeriodicDelayedTask::~PeriodicDelayedTask()
bool
PeriodicDelayedTask::RunIfNeeded(bigtime_t currentTime)
{
if (!currentTime < fRunAfter)
if (currentTime < fRunAfter)
return false;

fRunAfter = currentTime + fPeriod;
Expand Down

0 comments on commit 93bd491

Please sign in to comment.