mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-17 09:20:28 +03:00
AK: Replace uses of JsonObject::get_deprecated()/get_ptr()
This commit is contained in:
parent
8d3b268cca
commit
79547896b7
Notes:
sideshowbarker
2024-07-17 01:34:28 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/79547896b7 Pull-request: https://github.com/SerenityOS/serenity/pull/17044
@ -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_deprecated(element.key()) };
|
||||
root = JsonValue { root.as_object().get(element.key()).value() };
|
||||
break;
|
||||
case JsonPathElement::Kind::Index:
|
||||
root = JsonValue { root.as_array().at(element.index()) };
|
||||
|
@ -103,7 +103,11 @@ 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_deprecated(key));
|
||||
auto other_value = other.as_object().get(key);
|
||||
if (other_value.has_value())
|
||||
result &= value.equals(*other_value);
|
||||
else
|
||||
result = false;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user