Logic error in TaskLoop::RunIfNeeded()

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.
This commit is contained in:
Philippe Saint-Pierre 2015-07-01 19:22:24 -04:00
parent 2bdea08d38
commit 93bd491fb7

View File

@ -181,7 +181,7 @@ PeriodicDelayedTask::~PeriodicDelayedTask()
bool
PeriodicDelayedTask::RunIfNeeded(bigtime_t currentTime)
{
if (!currentTime < fRunAfter)
if (currentTime < fRunAfter)
return false;
fRunAfter = currentTime + fPeriod;