Fix contract for Timer.rearm.

This commit is contained in:
Sönke Ludwig 2020-03-14 18:38:47 +01:00
parent 5010085340
commit 0122e665db

View file

@ -1145,7 +1145,7 @@ struct Timer {
/** Resets the timer to the specified timeout /** Resets the timer to the specified timeout
*/ */
void rearm(Duration dur, bool periodic = false) nothrow void rearm(Duration dur, bool periodic = false) nothrow
in { assert(dur > 0.seconds, "Negative timer duration specified."); } in { assert(dur >= 0.seconds, "Negative timer duration specified."); }
body { m_driver.timers.set(m_id, dur, periodic ? dur : 0.seconds); } body { m_driver.timers.set(m_id, dur, periodic ? dur : 0.seconds); }
/** Resets the timer and avoids any firing. /** Resets the timer and avoids any firing.