AK: JsonObject::value_or() fallback value should be a const reference

This commit is contained in:
Andreas Kling 2021-03-08 10:58:56 +01:00
parent 9eff9b8cea
commit 483b45db3f

View file

@ -78,7 +78,7 @@ public:
return value ? *value : JsonValue(JsonValue::Type::Null);
}
JsonValue get_or(const String& key, JsonValue alternative) const
JsonValue get_or(const String& key, const JsonValue& alternative) const
{
auto* value = get_ptr(key);
return value ? *value : alternative;