Browse Source

LibELF: Use default instead of an empty constructor/destructor

Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
Brian Gianforcaro 3 years ago
parent
commit
5dbc72a158
2 changed files with 6 additions and 6 deletions
  1. 2 2
      Userland/Libraries/LibELF/DynamicObject.h
  2. 4 4
      Userland/Libraries/LibELF/Image.h

+ 2 - 2
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; }

+ 4 - 4
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)