diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-09-16 00:00:32 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-16 17:17:13 +0200 |
commit | e2d154c74da2ff5c9d9fde36c37c57e0a6c56c93 (patch) | |
tree | 4059ec193e90c9717ddbac41462a4e8bb0e167fa /Userland/Libraries/LibJS | |
parent | fda48d7a6bfa6f0b6e00e66ffbd078df4ec53dbf (diff) | |
download | serenity-e2d154c74da2ff5c9d9fde36c37c57e0a6c56c93.zip |
LibJS: Use default instead of an empty constructor/destructor
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Heap/CellAllocator.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Heap/CellAllocator.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Heap/Handle.h | 2 |
3 files changed, 2 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Heap/CellAllocator.cpp b/Userland/Libraries/LibJS/Heap/CellAllocator.cpp index 63e6e38fcf..e7b86ec040 100644 --- a/Userland/Libraries/LibJS/Heap/CellAllocator.cpp +++ b/Userland/Libraries/LibJS/Heap/CellAllocator.cpp @@ -17,10 +17,6 @@ CellAllocator::CellAllocator(size_t cell_size) { } -CellAllocator::~CellAllocator() -{ -} - Cell* CellAllocator::allocate_cell(Heap& heap) { if (m_usable_blocks.is_empty()) { diff --git a/Userland/Libraries/LibJS/Heap/CellAllocator.h b/Userland/Libraries/LibJS/Heap/CellAllocator.h index 43edfe69ff..737f0ab408 100644 --- a/Userland/Libraries/LibJS/Heap/CellAllocator.h +++ b/Userland/Libraries/LibJS/Heap/CellAllocator.h @@ -17,7 +17,7 @@ namespace JS { class CellAllocator { public: explicit CellAllocator(size_t cell_size); - ~CellAllocator(); + ~CellAllocator() = default; size_t cell_size() const { return m_cell_size; } diff --git a/Userland/Libraries/LibJS/Heap/Handle.h b/Userland/Libraries/LibJS/Heap/Handle.h index 07d01941ab..2ebc35770c 100644 --- a/Userland/Libraries/LibJS/Heap/Handle.h +++ b/Userland/Libraries/LibJS/Heap/Handle.h @@ -41,7 +41,7 @@ public: template<class T> class Handle { public: - Handle() { } + Handle() = default; static Handle create(T* cell) { |