summaryrefslogtreecommitdiff
path: root/AK/JsonObject.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-03-08 10:58:56 +0100
committerAndreas Kling <kling@serenityos.org>2021-03-08 11:50:36 +0100
commit483b45db3fa95da26003759ea995e782c6493d06 (patch)
treea504e8d268d03e908ec7a70f0eaa0d922e9fdf81 /AK/JsonObject.h
parent9eff9b8cea9c87d21c9b4dd2fc5df5fcdc11f729 (diff)
downloadserenity-483b45db3fa95da26003759ea995e782c6493d06.zip
AK: JsonObject::value_or() fallback value should be a const reference
Diffstat (limited to 'AK/JsonObject.h')
-rw-r--r--AK/JsonObject.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/AK/JsonObject.h b/AK/JsonObject.h
index c127887b37..73d0941c11 100644
--- a/AK/JsonObject.h
+++ b/AK/JsonObject.h
@@ -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;