浏览代码

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."
Lenny Maiorani 3 年之前
父节点
当前提交
a53c00f1df
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Userland/Libraries/LibThreading/BackgroundAction.h

+ 3 - 2
Userland/Libraries/LibThreading/BackgroundAction.h

@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
  * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
+ * 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<void()>);
     static Thread& background_thread();
@@ -48,7 +49,7 @@ public:
         return m_cancelled;
     }
 
-    virtual ~BackgroundAction() { }
+    virtual ~BackgroundAction() = default;
 
 private:
     BackgroundAction(Function<Result(BackgroundAction&)> action, Function<void(Result)> on_complete)