1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:08:13 +00:00

Kernel: Avoid redundant bool comparisons in Kernel::Thread

Two instances of comparing a bool with == true or == false, and one
instance where we can just return an expression instead of checking it
to return true on succeess and false on failure.
This commit is contained in:
Andrew Kaster 2021-10-31 16:52:43 -06:00 committed by Andreas Kling
parent c9d1c12efa
commit b1d5d3cc34
2 changed files with 4 additions and 6 deletions

View file

@ -883,7 +883,7 @@ public:
// NOTE: this may execute on the same or any other processor!
SpinlockLocker scheduler_lock(g_scheduler_lock);
SpinlockLocker block_lock(m_block_lock);
if (m_blocker && timeout_unblocked.exchange(true) == false)
if (m_blocker && !timeout_unblocked.exchange(true))
unblock();
});
if (!timer_was_added) {