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:
@@ -181,7 +181,7 @@ PeriodicDelayedTask::~PeriodicDelayedTask()
|
||||
bool
|
||||
PeriodicDelayedTask::RunIfNeeded(bigtime_t currentTime)
|
||||
{
|
||||
if (!currentTime < fRunAfter)
|
||||
if (currentTime < fRunAfter)
|
||||
return false;
|
||||
|
||||
fRunAfter = currentTime + fPeriod;
|
||||
|
||||
Reference in New Issue
Block a user