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

AK: Add JsonObject::set(key, &&value) overload.

This dodges a whole bunch of value copying in JsonParser.
This commit is contained in:
Andreas Kling 2019-07-08 13:08:21 +02:00
parent 7bb1e465c6
commit a8aadf73e9
2 changed files with 7 additions and 2 deletions

View file

@ -22,9 +22,14 @@ public:
return (*it).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, value);
m_members.set(key, JsonValue(value));
}
template<typename Callback>