mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
AK: Use default constructor/destructor instead of declaring an empty one
Default implementations allow for more optimizations. See: https://pvs-studio.com/en/docs/warnings/v832/
This commit is contained in:
parent
9fe43041f5
commit
c192c303d2
Notes:
sideshowbarker
2024-07-18 03:52:35 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/c192c303d22 Pull-request: https://github.com/SerenityOS/serenity/pull/10053
8 changed files with 7 additions and 16 deletions
|
@ -17,9 +17,7 @@ class CircularQueue {
|
|||
friend CircularDuplexStream<Capacity>;
|
||||
|
||||
public:
|
||||
CircularQueue()
|
||||
{
|
||||
}
|
||||
CircularQueue() = default;
|
||||
|
||||
~CircularQueue()
|
||||
{
|
||||
|
|
|
@ -52,9 +52,7 @@ class DistinctNumeric {
|
|||
using Self = DistinctNumeric<T, X, Incr, Cmp, Bool, Flags, Shift, Arith>;
|
||||
|
||||
public:
|
||||
constexpr DistinctNumeric()
|
||||
{
|
||||
}
|
||||
constexpr DistinctNumeric() = default;
|
||||
|
||||
constexpr DistinctNumeric(T value)
|
||||
: m_value { value }
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace AK {
|
|||
template<typename T>
|
||||
class FixedArray {
|
||||
public:
|
||||
FixedArray() { }
|
||||
FixedArray() = default;
|
||||
explicit FixedArray(size_t size)
|
||||
: m_size(size)
|
||||
{
|
||||
|
|
|
@ -16,9 +16,7 @@ class NonnullPtrVector : public Vector<PtrType, inline_capacity> {
|
|||
using Base = Vector<PtrType, inline_capacity>;
|
||||
|
||||
public:
|
||||
NonnullPtrVector()
|
||||
{
|
||||
}
|
||||
NonnullPtrVector() = default;
|
||||
|
||||
NonnullPtrVector(Vector<PtrType>&& other)
|
||||
: Base(static_cast<Base&&>(other))
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
|
||||
protected:
|
||||
BaseRedBlackTree() = default; // These are protected to ensure no one instantiates the leaky base red black tree directly
|
||||
virtual ~BaseRedBlackTree() {};
|
||||
virtual ~BaseRedBlackTree() = default;
|
||||
|
||||
void rotate_left(Node* subtree_root)
|
||||
{
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
#include <AK/UUID.h>
|
||||
|
||||
namespace AK {
|
||||
UUID::UUID()
|
||||
{
|
||||
}
|
||||
|
||||
UUID::UUID(Array<u8, 16> uuid_buffer)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace AK {
|
|||
|
||||
class UUID {
|
||||
public:
|
||||
UUID();
|
||||
UUID() = default;
|
||||
UUID(Array<u8, 16> uuid_buffer);
|
||||
UUID(const StringView&);
|
||||
~UUID() = default;
|
||||
|
|
|
@ -116,7 +116,7 @@ struct VariantConstructors {
|
|||
internal_cast().set(t, VariantNoClearTag {});
|
||||
}
|
||||
|
||||
ALWAYS_INLINE VariantConstructors() { }
|
||||
ALWAYS_INLINE VariantConstructors() = default;
|
||||
|
||||
private:
|
||||
[[nodiscard]] ALWAYS_INLINE Base& internal_cast()
|
||||
|
|
Loading…
Reference in a new issue