From a7364eef3ce797284de72687bb0dcbc4834a6324 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Wed, 15 Sep 2021 23:57:01 -0700 Subject: [PATCH] LibGUI: Use default instead of an empty constructor/destructor Default implementations allow for more optimizations. See: https://pvs-studio.com/en/docs/warnings/v832/ --- Userland/Libraries/LibGUI/Margins.h | 4 ++-- Userland/Libraries/LibGUI/ModelIndex.h | 2 +- Userland/Libraries/LibGUI/Shortcut.h | 2 +- Userland/Libraries/LibGUI/TextPosition.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibGUI/Margins.h b/Userland/Libraries/LibGUI/Margins.h index f51fb82d03..1c0b55f2fd 100644 --- a/Userland/Libraries/LibGUI/Margins.h +++ b/Userland/Libraries/LibGUI/Margins.h @@ -10,7 +10,7 @@ namespace GUI { class Margins { public: - Margins() { } + Margins() = default; Margins(int all) : m_top(all) , m_right(all) @@ -39,7 +39,7 @@ public: , m_left(left) { } - ~Margins() { } + ~Margins() = default; bool is_null() const { return !m_left && !m_top && !m_right && !m_bottom; } diff --git a/Userland/Libraries/LibGUI/ModelIndex.h b/Userland/Libraries/LibGUI/ModelIndex.h index a2d939c9d3..6e7141021d 100644 --- a/Userland/Libraries/LibGUI/ModelIndex.h +++ b/Userland/Libraries/LibGUI/ModelIndex.h @@ -17,7 +17,7 @@ class ModelIndex { friend class Model; public: - ModelIndex() { } + ModelIndex() = default; bool is_valid() const { return m_model && m_row != -1 && m_column != -1; } int row() const { return m_row; } diff --git a/Userland/Libraries/LibGUI/Shortcut.h b/Userland/Libraries/LibGUI/Shortcut.h index 5563f7f857..52d90a6f2d 100644 --- a/Userland/Libraries/LibGUI/Shortcut.h +++ b/Userland/Libraries/LibGUI/Shortcut.h @@ -13,7 +13,7 @@ namespace GUI { class Shortcut { public: - Shortcut() { } + Shortcut() = default; Shortcut(u8 modifiers, KeyCode key) : m_modifiers(modifiers) , m_key(key) diff --git a/Userland/Libraries/LibGUI/TextPosition.h b/Userland/Libraries/LibGUI/TextPosition.h index 951afe3504..e8621ba1f1 100644 --- a/Userland/Libraries/LibGUI/TextPosition.h +++ b/Userland/Libraries/LibGUI/TextPosition.h @@ -12,7 +12,7 @@ namespace GUI { class TextPosition { public: - TextPosition() { } + TextPosition() = default; TextPosition(size_t line, size_t column) : m_line(line) , m_column(column)