LibWeb: Use "= default" to declare empty constructors and descructors
A types which have special functions declared with "= default can be trivially copied. Besides being good practice, the compiler might be able generate copy and initialize code in a more optimized way. Found By PVS-Studio: https://pvs-studio.com/en/docs/warnings/v832/
This commit is contained in:
parent
027cbe6b89
commit
6781d60e3a
Notes:
sideshowbarker
2024-07-18 02:51:33 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/6781d60e3ac Pull-request: https://github.com/SerenityOS/serenity/pull/10418
2 changed files with 3 additions and 3 deletions
Userland/Libraries/LibWeb
|
@ -20,7 +20,7 @@ class MediaQuery : public RefCounted<MediaQuery> {
|
|||
friend class Parser;
|
||||
|
||||
public:
|
||||
~MediaQuery() { }
|
||||
~MediaQuery() = default;
|
||||
|
||||
// https://www.w3.org/TR/mediaqueries-4/#media-types
|
||||
enum class MediaType {
|
||||
|
@ -82,7 +82,7 @@ public:
|
|||
String to_string() const;
|
||||
|
||||
private:
|
||||
MediaQuery() { }
|
||||
MediaQuery() = default;
|
||||
|
||||
// https://www.w3.org/TR/mediaqueries-4/#mq-not
|
||||
bool m_negated { false };
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
, m_handler(move(handler))
|
||||
{
|
||||
}
|
||||
~RequestAnimationFrameCallback() { }
|
||||
~RequestAnimationFrameCallback() = default;
|
||||
|
||||
i32 id() const { return m_id; }
|
||||
bool is_cancelled() const { return !m_handler; }
|
||||
|
|
Loading…
Add table
Reference in a new issue