From a53c00f1df5e6e8eafd9ea32d51f5a7fa0aa3f1c Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Fri, 4 Mar 2022 13:26:44 -0700 Subject: [PATCH] Libraries: Use default constructors/destructors in LibThreading https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler." --- Userland/Libraries/LibThreading/BackgroundAction.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibThreading/BackgroundAction.h b/Userland/Libraries/LibThreading/BackgroundAction.h index ee2b95dd80..a567851176 100644 --- a/Userland/Libraries/LibThreading/BackgroundAction.h +++ b/Userland/Libraries/LibThreading/BackgroundAction.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2019-2020, Sergey Bugaev * Copyright (c) 2021, Andreas Kling + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -26,7 +27,7 @@ class BackgroundActionBase { friend class BackgroundAction; private: - BackgroundActionBase() { } + BackgroundActionBase() = default; static void enqueue_work(Function); static Thread& background_thread(); @@ -48,7 +49,7 @@ public: return m_cancelled; } - virtual ~BackgroundAction() { } + virtual ~BackgroundAction() = default; private: BackgroundAction(Function action, Function on_complete)