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

AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()

This is a preparatory step to making `get()` return `ErrorOr`.
This commit is contained in:
Sam Atkins 2022-12-21 11:42:06 +00:00 committed by Tim Flynn
parent efe4329f9f
commit 1dd6b7f5b7
76 changed files with 671 additions and 671 deletions

View file

@ -52,7 +52,7 @@ public:
[[nodiscard]] size_t size() const { return m_members.size(); }
[[nodiscard]] bool is_empty() const { return m_members.is_empty(); }
[[nodiscard]] JsonValue const& get(StringView key) const
[[nodiscard]] JsonValue const& get_deprecated(StringView key) const
{
auto const* value = get_ptr(key);
static JsonValue* s_null_value { nullptr };

View file

@ -19,7 +19,7 @@ JsonValue JsonPath::resolve(JsonValue const& top_root) const
for (auto const& element : *this) {
switch (element.kind()) {
case JsonPathElement::Kind::Key:
root = JsonValue { root.as_object().get(element.key()) };
root = JsonValue { root.as_object().get_deprecated(element.key()) };
break;
case JsonPathElement::Kind::Index:
root = JsonValue { root.as_array().at(element.index()) };

View file

@ -103,7 +103,7 @@ bool JsonValue::equals(JsonValue const& other) const
if (is_object() && other.is_object() && as_object().size() == other.as_object().size()) {
bool result = true;
as_object().for_each_member([&](auto& key, auto& value) {
result &= value.equals(other.as_object().get(key));
result &= value.equals(other.as_object().get_deprecated(key));
});
return result;
}