From c3cff7d70a27e93c2006cbe78f3c2d00da7a44a2 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 26 Apr 2021 17:21:15 +0200 Subject: [PATCH] Kernel: Simplify BlockTimeout constructor --- Kernel/ThreadBlockers.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Kernel/ThreadBlockers.cpp b/Kernel/ThreadBlockers.cpp index 709b102679..ec6cbb0d99 100644 --- a/Kernel/ThreadBlockers.cpp +++ b/Kernel/ThreadBlockers.cpp @@ -17,15 +17,15 @@ Thread::BlockTimeout::BlockTimeout(bool is_absolute, const Time* time, const Tim : m_clock_id(clock_id) , m_infinite(!time) { - if (!m_infinite) { - if (*time > Time::zero()) { - m_time = *time; - m_should_block = true; - } - m_start_time = start_time ? *start_time : TimeManagement::the().current_time(clock_id).value(); - if (!is_absolute) - m_time = m_time + m_start_time; + if (m_infinite) + return; + if (*time > Time::zero()) { + m_time = *time; + m_should_block = true; } + m_start_time = start_time ? *start_time : TimeManagement::the().current_time(clock_id).value(); + if (!is_absolute) + m_time += m_start_time; } bool Thread::Blocker::set_block_condition(Thread::BlockCondition& block_condition, void* data)