1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +00:00

Userland: Avoid a bunch of JsonObject copies

JsonValue::as_object() returns a reference.
This commit is contained in:
Linus Groh 2021-05-31 17:59:02 +01:00
parent a6248101e2
commit 16d51d78c0
11 changed files with 12 additions and 13 deletions

View file

@ -42,7 +42,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
auto json = JsonValue::from_string(file_contents);
VERIFY(json.has_value());
json.value().as_array().for_each([](auto& value) {
auto handler = value.as_object();
auto& handler = value.as_object();
auto purpose = handler.get("purpose").to_string();
auto interrupt = handler.get("interrupt_line").to_string();
auto controller = handler.get("controller").to_string();