QTest::qWaitFor: remove superfluous check for isForever()

When a QDeadLineTimer::isForever() then its remainingTime() is
chrono::nanoseconds::max(), which is exactly representable as
chrono::milliseconds, and greater than 10ms, so the following code
would have done the right thing already.

Let it.

This also removes the duplicate mentioning of the 10ms sleeping
timeslice.

Amends fa296ee1dc.

Pick-to: 6.7
Change-Id: Ibc32d6069b78cd4583df07d0707d98645440b36c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Marc Mutz 2024-03-08 11:27:57 +01:00
parent f38ba1827c
commit e102edfbf8
1 changed files with 0 additions and 5 deletions

View File

@ -43,11 +43,6 @@ qWaitFor(Functor predicate, QDeadlineTimer deadline = QDeadlineTimer(std::chrono
if (predicate())
return true;
if (deadline.isForever()) { // No point checking remaining time
qSleep(10ms);
continue;
}
const auto remaining = ceil<milliseconds>(deadline.remainingTimeAsDuration());
if (remaining == 0ms)
break;