浏览代码

Libraries: Use default constructors/destructors in LibSyntax

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 年之前
父节点
当前提交
7cc6ba16be
共有 2 个文件被更改,包括 3 次插入7 次删除
  1. 1 5
      Userland/Libraries/LibSyntax/Highlighter.cpp
  2. 2 2
      Userland/Libraries/LibSyntax/Highlighter.h

+ 1 - 5
Userland/Libraries/LibSyntax/Highlighter.cpp

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020-2021, the SerenityOS developers.
+ * Copyright (c) 2020-2022, the SerenityOS developers.
  *
  * SPDX-License-Identifier: BSD-2-Clause
  */
@@ -10,10 +10,6 @@
 
 namespace Syntax {
 
-Highlighter::~Highlighter()
-{
-}
-
 void Highlighter::highlight_matching_token_pair()
 {
     auto& document = m_client->get_document();

+ 2 - 2
Userland/Libraries/LibSyntax/Highlighter.h

@@ -37,7 +37,7 @@ class Highlighter {
     AK_MAKE_NONMOVABLE(Highlighter);
 
 public:
-    virtual ~Highlighter();
+    virtual ~Highlighter() = default;
 
     virtual Language language() const = 0;
     StringView language_string(Language) const;
@@ -64,7 +64,7 @@ public:
     virtual bool is_cpp_semantic_highlighter() const { return false; }
 
 protected:
-    Highlighter() { }
+    Highlighter() = default;
 
     // FIXME: This should be WeakPtr somehow
     HighlighterClient* m_client { nullptr };