summaryrefslogtreecommitdiff
path: root/AK/JsonObject.h
diff options
context:
space:
mode:
authorMax Wipfli <mail@maxwipfli.ch>2021-06-28 10:21:20 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-29 13:18:03 +0200
commit53480180cb1aecdbf995eb5a59d67dfd1f698e8a (patch)
tree3f4a3798103f8c3bb76fb72a829d8231f00138a6 /AK/JsonObject.h
parent9179a2ea7347fb4ee43848e11c6660dda7a60023 (diff)
downloadserenity-53480180cb1aecdbf995eb5a59d67dfd1f698e8a.zip
AK: Use east const style in Json{Array,Object}.h
Diffstat (limited to 'AK/JsonObject.h')
-rw-r--r--AK/JsonObject.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/AK/JsonObject.h b/AK/JsonObject.h
index bfeeb928cf..9aa5bc83cd 100644
--- a/AK/JsonObject.h
+++ b/AK/JsonObject.h
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2021, Max Wipfli <mail@maxwipfli.ch>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -19,7 +20,7 @@ public:
JsonObject() = default;
~JsonObject() = default;
- JsonObject(const JsonObject& other)
+ JsonObject(JsonObject const& other)
: m_order(other.m_order)
, m_members(other.m_members)
{
@@ -31,7 +32,7 @@ public:
{
}
- JsonObject& operator=(const JsonObject& other)
+ JsonObject& operator=(JsonObject const& other)
{
if (this != &other) {
m_members = other.m_members;
@@ -52,19 +53,19 @@ public:
int size() const { return m_members.size(); }
bool is_empty() const { return m_members.is_empty(); }
- JsonValue get(const String& key) const
+ JsonValue get(String const& key) const
{
auto* value = get_ptr(key);
return value ? *value : JsonValue(JsonValue::Type::Null);
}
- JsonValue get_or(const String& key, const JsonValue& alternative) const
+ JsonValue get_or(String const& key, JsonValue const& alternative) const
{
auto* value = get_ptr(key);
return value ? *value : alternative;
}
- const JsonValue* get_ptr(const String& key) const
+ JsonValue const* get_ptr(String const& key) const
{
auto it = m_members.find(key);
if (it == m_members.end())
@@ -72,12 +73,12 @@ public:
return &(*it).value;
}
- bool has(const String& key) const
+ bool has(String const& key) const
{
return m_members.contains(key);
}
- void set(const String& key, JsonValue value)
+ void set(String const& key, JsonValue value)
{
if (m_members.set(key, move(value)) == HashSetResult::ReplacedExistingEntry)
m_order.remove(m_order.find_first_index(key).value());
@@ -93,7 +94,7 @@ public:
}
}
- bool remove(const String& key)
+ bool remove(String const& key)
{
if (m_members.remove(key)) {
m_order.remove(m_order.find_first_index(key).value());