LibWeb: Use default instead of an empty constructor/destructor

Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
This commit is contained in:
Brian Gianforcaro 2021-09-15 23:24:47 -07:00 committed by Andreas Kling
parent 14eb736e22
commit 2b57018196
Notes: sideshowbarker 2024-07-18 03:52:28 +09:00
6 changed files with 5 additions and 9 deletions

View File

@ -35,7 +35,7 @@ public:
Vmin,
};
Length() { }
Length() = default;
Length(int value, Type type)
: m_type(type)
, m_value(value)

View File

@ -31,10 +31,6 @@ static void log_parse_error(const SourceLocation& location = SourceLocation::cur
namespace Web::CSS {
ParsingContext::ParsingContext()
{
}
ParsingContext::ParsingContext(DOM::Document& document)
: m_document(&document)
{

View File

@ -32,7 +32,7 @@ enum class PropertyID;
class ParsingContext {
public:
ParsingContext();
ParsingContext() = default;
explicit ParsingContext(DOM::Document&);
explicit ParsingContext(DOM::ParentNode&);

View File

@ -47,7 +47,7 @@ public:
const Element* next_element_in_pre_order() const { return const_cast<NonDocumentTypeChildNode*>(this)->next_element_in_pre_order(); }
protected:
NonDocumentTypeChildNode() { }
NonDocumentTypeChildNode() = default;
};
}

View File

@ -34,7 +34,7 @@ public:
}
protected:
NonElementParentNode() { }
NonElementParentNode() = default;
};
}

View File

@ -419,7 +419,7 @@ public:
}
protected:
TreeNode() { }
TreeNode() = default;
bool m_deletion_has_begun { false };
bool m_in_removed_last_ref { false };