diff options
author | Lenny Maiorani <lenny@serenityos.org> | 2022-03-23 20:58:03 -0600 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-03-24 20:09:26 -0700 |
commit | 0b7baa7e5a556f82988ad4f6b39fed8cd38ae9fd (patch) | |
tree | 85342dfcc6110883cf5865abe3f4bdae0f308173 /Userland/Services/Clipboard | |
parent | 5550905c00c097b92eb5832fc92b88a00018620b (diff) | |
download | serenity-0b7baa7e5a556f82988ad4f6b39fed8cd38ae9fd.zip |
Services: Use default constructors/destructors
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."
Diffstat (limited to 'Userland/Services/Clipboard')
-rw-r--r-- | Userland/Services/Clipboard/ConnectionFromClient.cpp | 4 | ||||
-rw-r--r-- | Userland/Services/Clipboard/ConnectionFromClient.h | 2 | ||||
-rw-r--r-- | Userland/Services/Clipboard/Storage.cpp | 8 | ||||
-rw-r--r-- | Userland/Services/Clipboard/Storage.h | 4 |
4 files changed, 3 insertions, 15 deletions
diff --git a/Userland/Services/Clipboard/ConnectionFromClient.cpp b/Userland/Services/Clipboard/ConnectionFromClient.cpp index 9a26642357..f152b609b0 100644 --- a/Userland/Services/Clipboard/ConnectionFromClient.cpp +++ b/Userland/Services/Clipboard/ConnectionFromClient.cpp @@ -25,10 +25,6 @@ ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSock s_connections.set(client_id, *this); } -ConnectionFromClient::~ConnectionFromClient() -{ -} - void ConnectionFromClient::die() { s_connections.remove(client_id()); diff --git a/Userland/Services/Clipboard/ConnectionFromClient.h b/Userland/Services/Clipboard/ConnectionFromClient.h index 94f23a07f1..7761d83838 100644 --- a/Userland/Services/Clipboard/ConnectionFromClient.h +++ b/Userland/Services/Clipboard/ConnectionFromClient.h @@ -18,7 +18,7 @@ class ConnectionFromClient final C_OBJECT(ConnectionFromClient); public: - virtual ~ConnectionFromClient() override; + virtual ~ConnectionFromClient() override = default; virtual void die() override; diff --git a/Userland/Services/Clipboard/Storage.cpp b/Userland/Services/Clipboard/Storage.cpp index 5bc7f48aaa..9740d03b12 100644 --- a/Userland/Services/Clipboard/Storage.cpp +++ b/Userland/Services/Clipboard/Storage.cpp @@ -14,14 +14,6 @@ Storage& Storage::the() return s_the; } -Storage::Storage() -{ -} - -Storage::~Storage() -{ -} - void Storage::set_data(Core::AnonymousBuffer data, const String& mime_type, const HashMap<String, String>& metadata) { m_buffer = move(data); diff --git a/Userland/Services/Clipboard/Storage.h b/Userland/Services/Clipboard/Storage.h index 204fac61c9..07cfb46bf4 100644 --- a/Userland/Services/Clipboard/Storage.h +++ b/Userland/Services/Clipboard/Storage.h @@ -16,7 +16,7 @@ namespace Clipboard { class Storage { public: static Storage& the(); - ~Storage(); + ~Storage() = default; bool has_data() const { return m_buffer.is_valid(); } @@ -44,7 +44,7 @@ public: const Core::AnonymousBuffer& buffer() const { return m_buffer; } private: - Storage(); + Storage() = default; String m_mime_type; Core::AnonymousBuffer m_buffer; |