From 7030a9b496fddf0c64ee456672deac0014e553e0 Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Sat, 26 Feb 2022 09:06:06 -0700 Subject: [PATCH] Libraries: Use default constructors/destructors in LibChess 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/LibChess/UCICommand.h | 4 ++-- Userland/Libraries/LibChess/UCIEndpoint.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibChess/UCICommand.h b/Userland/Libraries/LibChess/UCICommand.h index a72b78025ca..33415ae8c54 100644 --- a/Userland/Libraries/LibChess/UCICommand.h +++ b/Userland/Libraries/LibChess/UCICommand.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, the SerenityOS developers. + * Copyright (c) 2020-2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -46,7 +46,7 @@ public: virtual String to_string() const = 0; - virtual ~Command() { } + virtual ~Command() = default; }; class UCICommand : public Command { diff --git a/Userland/Libraries/LibChess/UCIEndpoint.h b/Userland/Libraries/LibChess/UCIEndpoint.h index 430d8edcfcd..f9843ae8cff 100644 --- a/Userland/Libraries/LibChess/UCIEndpoint.h +++ b/Userland/Libraries/LibChess/UCIEndpoint.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, the SerenityOS developers. + * Copyright (c) 2020-2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -16,7 +16,7 @@ namespace Chess::UCI { class Endpoint : public Core::Object { C_OBJECT(Endpoint) public: - virtual ~Endpoint() override { } + virtual ~Endpoint() override = default; virtual void handle_uci() { } virtual void handle_debug(const DebugCommand&) { } @@ -46,7 +46,7 @@ public: void set_out(RefPtr out) { m_out = out; } protected: - Endpoint() { } + Endpoint() = default; Endpoint(NonnullRefPtr in, NonnullRefPtr out); private: