mirror of
https://github.com/danog/amp.git
synced 2024-11-26 20:15:00 +01:00
Micro-optimize interval = 0 if
This commit is contained in:
parent
38ef4d9ffa
commit
ef6c2b10ee
@ -59,9 +59,7 @@ class EvDriver extends Driver {
|
||||
|
||||
if ($watcher->type & Watcher::DELAY) {
|
||||
$this->cancel($watcher->id);
|
||||
}
|
||||
|
||||
if ($watcher->type & Watcher::REPEAT && $watcher->value === 0) {
|
||||
} elseif ($watcher->value === 0) {
|
||||
// Disable and re-enable so it's not executed repeatedly in the same tick
|
||||
// See https://github.com/amphp/amp/issues/131
|
||||
$this->disable($watcher->id);
|
||||
|
@ -88,9 +88,7 @@ class UvDriver extends Driver {
|
||||
if ($watcher->type & Watcher::DELAY) {
|
||||
unset($this->events[$watcher->id], $this->watchers[(int) $event]); // Avoid call to uv_is_active().
|
||||
$this->cancel($watcher->id); // Remove reference to watcher in parent.
|
||||
}
|
||||
|
||||
if ($watcher->type & Watcher::REPEAT && $watcher->value === 0) {
|
||||
} elseif ($watcher->value === 0) {
|
||||
// Disable and re-enable so it's not executed repeatedly in the same tick
|
||||
// See https://github.com/amphp/amp/issues/131
|
||||
$this->disable($watcher->id);
|
||||
|
Loading…
Reference in New Issue
Block a user