mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
Userland: Avoid a bunch of JsonObject copies
JsonValue::as_object() returns a reference.
This commit is contained in:
parent
a6248101e2
commit
16d51d78c0
Notes:
sideshowbarker
2024-07-18 17:06:20 +09:00
Author: https://github.com/linusg
Commit: 16d51d78c0
11 changed files with 12 additions and 13 deletions
|
@ -48,7 +48,7 @@ int main(int argc, char** argv)
|
|||
auto json = JsonValue::from_string(file_contents);
|
||||
VERIFY(json.has_value());
|
||||
json.value().as_array().for_each([](auto& value) {
|
||||
auto if_object = value.as_object();
|
||||
auto& if_object = value.as_object();
|
||||
|
||||
auto name = if_object.get("name").to_string();
|
||||
auto class_name = if_object.get("class_name").to_string();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue