1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:27:45 +00:00

Libraries: Use AK::Variant default initialization where appropriate

This commit is contained in:
Ben Wiederhake 2021-09-19 23:00:45 +02:00 committed by Ali Mohammad Pur
parent 98a0f9c0bd
commit 32e98d0924
8 changed files with 12 additions and 12 deletions

View file

@ -317,8 +317,8 @@ struct BindingPattern : RefCounted<BindingPattern> {
// This covers both BindingProperty and BindingElement, hence the more generic name
struct BindingEntry {
// If this entry represents a BindingElement, then name will be Empty
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<Expression>, Empty> name { Empty {} };
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>, Empty> alias { Empty {} };
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<Expression>, Empty> name {};
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>, Empty> alias {};
RefPtr<Expression> initializer {};
bool is_rest { false };

View file

@ -2180,7 +2180,7 @@ NonnullRefPtr<VariableDeclaration> Parser::parse_variable_declaration(bool for_l
NonnullRefPtrVector<VariableDeclarator> declarations;
for (;;) {
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>, Empty> target { Empty() };
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>, Empty> target {};
if (match_identifier()) {
auto identifier_start = push_start();
auto name = consume_identifier().value();

View file

@ -239,7 +239,7 @@ private:
String m_message;
StringView m_trivia;
StringView m_original_value;
Variant<Empty, StringView, FlyString> m_value { Empty {} };
Variant<Empty, StringView, FlyString> m_value {};
StringView m_filename;
size_t m_line_number { 0 };
size_t m_line_column { 0 };