diff options
author | Lenny Maiorani <lenny@serenityos.org> | 2022-03-04 13:26:19 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-13 22:34:38 +0100 |
commit | 7cc6ba16bee02c9984604b9c8c878af11561cfd6 (patch) | |
tree | 9e2f4a1437f593a58ad2fa627bdc2982f4fd8557 | |
parent | 7abb7822061f9aa0eadf2cb82d9f29f7349b61f7 (diff) | |
download | serenity-7cc6ba16bee02c9984604b9c8c878af11561cfd6.zip |
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."
-rw-r--r-- | Userland/Libraries/LibSyntax/Highlighter.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibSyntax/Highlighter.h | 4 |
2 files changed, 3 insertions, 7 deletions
diff --git a/Userland/Libraries/LibSyntax/Highlighter.cpp b/Userland/Libraries/LibSyntax/Highlighter.cpp index 0b01d10ff9..a3e97d6ac2 100644 --- a/Userland/Libraries/LibSyntax/Highlighter.cpp +++ b/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(); diff --git a/Userland/Libraries/LibSyntax/Highlighter.h b/Userland/Libraries/LibSyntax/Highlighter.h index c18fd54788..984c52857d 100644 --- a/Userland/Libraries/LibSyntax/Highlighter.h +++ b/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 }; |