1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:17:34 +00:00

AK: Simplify JsonObject and JsonArray API a little bit

Instead of set(const JsonValue&) and set(JsonValue&&), just do
set(JsonValue) and let callers move() if they want. This removes some
ambiguity and the compiler is smart enough to optimize it anyway.
This commit is contained in:
Andreas Kling 2020-03-06 08:49:48 +01:00
parent 211e938234
commit dc039fdc7e
2 changed files with 2 additions and 8 deletions

View file

@ -85,16 +85,11 @@ public:
return m_members.contains(key);
}
void set(const String& key, JsonValue&& value)
void set(const String& key, JsonValue value)
{
m_members.set(key, move(value));
}
void set(const String& key, const JsonValue& value)
{
m_members.set(key, JsonValue(value));
}
template<typename Callback>
void for_each_member(Callback callback) const
{