From 4c7281dd0147dc7ba42129344f4ca2b1555a7737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sat, 21 Jan 2017 17:27:54 +0100 Subject: [PATCH] Trivial refactor. --- source/eventcore/drivers/timer.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/eventcore/drivers/timer.d b/source/eventcore/drivers/timer.d index 49f3769..80e3ad9 100644 --- a/source/eventcore/drivers/timer.d +++ b/source/eventcore/drivers/timer.d @@ -32,7 +32,8 @@ final class LoopTimeoutTimerDriver : EventDriverTimers { final package Duration getNextTimeout(long stdtime) @safe nothrow { - return m_timerQueue.length ? (m_timerQueue.front.timeout - stdtime).hnsecs : Duration.max; + if (m_timerQueue.length == 0) return Duration.max; + return (m_timerQueue.front.timeout - stdtime).hnsecs; } final package bool process(long stdtime)