From 5dbc72a1585c7992b2187db42516b5a49dd6c19d Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Wed, 15 Sep 2021 23:31:35 -0700 Subject: [PATCH] LibELF: 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/LibELF/DynamicObject.h | 4 ++-- Userland/Libraries/LibELF/Image.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibELF/DynamicObject.h b/Userland/Libraries/LibELF/DynamicObject.h index db25516862..3773cf3ffe 100644 --- a/Userland/Libraries/LibELF/DynamicObject.h +++ b/Userland/Libraries/LibELF/DynamicObject.h @@ -38,7 +38,7 @@ public: { } - ~DynamicEntry() { } + ~DynamicEntry() = default; ElfW(Sword) tag() const { return m_dyn.d_tag; } ElfW(Addr) ptr() const { return m_dyn.d_un.d_ptr; } @@ -161,7 +161,7 @@ public: { } - ~Relocation() { } + ~Relocation() = default; unsigned offset_in_section() const { return m_offset_in_section; } unsigned offset() const { return m_rel.r_offset; } diff --git a/Userland/Libraries/LibELF/Image.h b/Userland/Libraries/LibELF/Image.h index 8033206601..e2cea92422 100644 --- a/Userland/Libraries/LibELF/Image.h +++ b/Userland/Libraries/LibELF/Image.h @@ -47,7 +47,7 @@ public: { } - ~Symbol() { } + ~Symbol() = default; StringView name() const { return m_image.table_string(m_sym.st_name); } unsigned section_index() const { return m_sym.st_shndx; } @@ -88,7 +88,7 @@ public: , m_program_header_index(program_header_index) { } - ~ProgramHeader() { } + ~ProgramHeader() = default; unsigned index() const { return m_program_header_index; } u32 type() const { return m_program_header.p_type; } @@ -118,7 +118,7 @@ public: , m_section_index(sectionIndex) { } - ~Section() { } + ~Section() = default; StringView name() const { return m_image.section_header_table_string(m_section_header.sh_name); } u32 type() const { return m_section_header.sh_type; } @@ -162,7 +162,7 @@ public: { } - ~Relocation() { } + ~Relocation() = default; size_t offset() const { return m_rel.r_offset; } #if ARCH(I386)