From 39993a8fabe417bfddc6fc611a81b5f611b6f745 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 31 Oct 2021 16:51:08 -0600 Subject: [PATCH] Kernel: Avoid else after return in Process and ThreadSafeRefCounted --- Kernel/Library/ThreadSafeRefCounted.h | 4 ++-- Kernel/Process.h | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Kernel/Library/ThreadSafeRefCounted.h b/Kernel/Library/ThreadSafeRefCounted.h index 93d23a4dca..cc7e1caf35 100644 --- a/Kernel/Library/ThreadSafeRefCounted.h +++ b/Kernel/Library/ThreadSafeRefCounted.h @@ -100,9 +100,9 @@ public: call_will_be_destroyed_if_present(static_cast(this)); delete static_cast(this); return true; - } else if (new_ref_count == 1) { - call_one_ref_left_if_present(static_cast(this)); } + if (new_ref_count == 1) + call_one_ref_left_if_present(static_cast(this)); return false; } }; diff --git a/Kernel/Process.h b/Kernel/Process.h index 634c36d628..e37475a399 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -577,10 +577,9 @@ private: { if (g_profiling_all_threads) return g_global_perf_events; - else if (m_profiling) + if (m_profiling) return m_perf_event_buffer.ptr(); - else - return nullptr; + return nullptr; } mutable IntrusiveListNode m_list_node;