diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-12-22 14:28:07 +0000 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2023-02-03 07:19:52 -0500 |
commit | a04ca015bfcff59fecd1574070a66f77086f5cab (patch) | |
tree | 7630bb6b61d6a231de3886881d2d87aa63648a36 /Userland/Utilities/lsirq.cpp | |
parent | 7ce32cb82af93a713217139f9c17d8c63fc145a3 (diff) | |
download | serenity-a04ca015bfcff59fecd1574070a66f77086f5cab.zip |
Utilities/lsirq: Replace uses of JsonObject::get_deprecated()/get_ptr()
Diffstat (limited to 'Userland/Utilities/lsirq.cpp')
-rw-r--r-- | Userland/Utilities/lsirq.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Utilities/lsirq.cpp b/Userland/Utilities/lsirq.cpp index 2f7cd4be26..b572563905 100644 --- a/Userland/Utilities/lsirq.cpp +++ b/Userland/Utilities/lsirq.cpp @@ -24,7 +24,7 @@ ErrorOr<int> serenity_main(Main::Arguments) auto file_contents = TRY(proc_interrupts->read_until_eof()); auto json = TRY(JsonValue::from_string(file_contents)); - auto cpu_count = json.as_array().at(0).as_object().get_deprecated("per_cpu_call_counts"sv).as_array().size(); + auto cpu_count = json.as_array().at(0).as_object().get_array("per_cpu_call_counts"sv)->size(); out(" "sv); for (size_t i = 0; i < cpu_count; ++i) { @@ -34,10 +34,10 @@ ErrorOr<int> serenity_main(Main::Arguments) json.as_array().for_each([cpu_count](JsonValue const& value) { auto& handler = value.as_object(); - auto purpose = handler.get_deprecated("purpose"sv).to_deprecated_string(); - auto interrupt = handler.get_deprecated("interrupt_line"sv).to_deprecated_string(); - auto controller = handler.get_deprecated("controller"sv).to_deprecated_string(); - auto call_counts = handler.get_deprecated("per_cpu_call_counts"sv).as_array(); + auto purpose = handler.get_deprecated_string("purpose"sv).value_or({}); + auto interrupt = handler.get_deprecated_string("interrupt_line"sv).value_or({}); + auto controller = handler.get_deprecated_string("controller"sv).value_or({}); + auto call_counts = handler.get_array("per_cpu_call_counts"sv).value(); out("{:>4}: ", interrupt); |