1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 20:17:41 +00:00

Kernel: Simplify some if statements

This commit is contained in:
Hendiadyoin1 2021-12-29 01:03:09 +01:00 committed by Andreas Kling
parent 04d75f4ff9
commit 23037d619a
3 changed files with 3 additions and 8 deletions

View file

@ -336,9 +336,7 @@ private:
ProcFSSelfProcessDirectory(); ProcFSSelfProcessDirectory();
virtual bool acquire_link(KBufferBuilder& builder) override virtual bool acquire_link(KBufferBuilder& builder) override
{ {
if (builder.appendff("{}", Process::current().pid().value()).is_error()) return !builder.appendff("{}", Process::current().pid().value()).is_error();
return false;
return true;
} }
}; };

View file

@ -517,7 +517,7 @@ void Scheduler::invoke_async()
void Scheduler::notify_finalizer() void Scheduler::notify_finalizer()
{ {
if (g_finalizer_has_work.exchange(true, AK::MemoryOrder::memory_order_acq_rel) == false) if (!g_finalizer_has_work.exchange(true, AK::MemoryOrder::memory_order_acq_rel))
g_finalizer_wait_queue->wake_all(); g_finalizer_wait_queue->wake_all();
} }

View file

@ -61,10 +61,7 @@ static void serial_putch(char ch)
IO::out8(0x3F8, ch); IO::out8(0x3F8, ch);
if (ch == '\r') was_cr = ch == '\r';
was_cr = true;
else
was_cr = false;
} }
static void critical_console_out(char ch) static void critical_console_out(char ch)