diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp index c56e0a12a1..73e8226e6a 100644 --- a/Userland/Applications/SpaceAnalyzer/main.cpp +++ b/Userland/Applications/SpaceAnalyzer/main.cpp @@ -86,7 +86,7 @@ static void fill_mounts(Vector& output) VERIFY(json.has_value()); json.value().as_array().for_each([&output](auto& value) { - auto filesystem_object = value.as_object(); + auto& filesystem_object = value.as_object(); MountInfo mount_info; mount_info.mount_point = filesystem_object.get("mount_point").to_string(); mount_info.source = filesystem_object.get("source").as_string_or("none"); diff --git a/Userland/Utilities/arp.cpp b/Userland/Utilities/arp.cpp index 1f38705437..5684bd7a85 100644 --- a/Userland/Utilities/arp.cpp +++ b/Userland/Utilities/arp.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -24,7 +23,7 @@ int main() 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 ip_address = if_object.get("ip_address").to_string(); auto mac_address = if_object.get("mac_address").to_string(); diff --git a/Userland/Utilities/df.cpp b/Userland/Utilities/df.cpp index 8717c447b8..7b80e6d4c3 100644 --- a/Userland/Utilities/df.cpp +++ b/Userland/Utilities/df.cpp @@ -56,7 +56,7 @@ int main(int argc, char** argv) VERIFY(json_result.has_value()); auto json = json_result.value().as_array(); json.for_each([](auto& value) { - auto fs_object = value.as_object(); + auto& fs_object = value.as_object(); auto fs = fs_object.get("class_name").to_string(); auto total_block_count = fs_object.get("total_block_count").to_u64(); auto free_block_count = fs_object.get("free_block_count").to_u64(); diff --git a/Userland/Utilities/fortune.cpp b/Userland/Utilities/fortune.cpp index a76563e338..94ceff7e78 100644 --- a/Userland/Utilities/fortune.cpp +++ b/Userland/Utilities/fortune.cpp @@ -24,7 +24,7 @@ public: { if (!value.is_object()) return {}; - auto entry = value.as_object(); + auto& entry = value.as_object(); Quote q; if (!entry.has("quote") || !entry.has("author") || !entry.has("utc_time") || !entry.has("url")) return {}; diff --git a/Userland/Utilities/ifconfig.cpp b/Userland/Utilities/ifconfig.cpp index 41c7b03aaa..37c4b8a1f3 100644 --- a/Userland/Utilities/ifconfig.cpp +++ b/Userland/Utilities/ifconfig.cpp @@ -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(); diff --git a/Userland/Utilities/jp.cpp b/Userland/Utilities/jp.cpp index 4ee1a852b6..0685672079 100644 --- a/Userland/Utilities/jp.cpp +++ b/Userland/Utilities/jp.cpp @@ -68,7 +68,7 @@ void print(const JsonValue& value, int spaces_per_indent, int indent, bool use_c { if (value.is_object()) { size_t printed_members = 0; - auto object = value.as_object(); + auto& object = value.as_object(); outln("{{"); object.for_each_member([&](auto& member_name, auto& member_value) { ++printed_members; diff --git a/Userland/Utilities/lsirq.cpp b/Userland/Utilities/lsirq.cpp index 79196c47a6..4b30c893ea 100644 --- a/Userland/Utilities/lsirq.cpp +++ b/Userland/Utilities/lsirq.cpp @@ -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(); diff --git a/Userland/Utilities/lspci.cpp b/Userland/Utilities/lspci.cpp index c71dd39cbb..660f4822b3 100644 --- a/Userland/Utilities/lspci.cpp +++ b/Userland/Utilities/lspci.cpp @@ -69,7 +69,7 @@ int main(int argc, char** argv) auto json = JsonValue::from_string(file_contents); VERIFY(json.has_value()); json.value().as_array().for_each([db, format](auto& value) { - auto dev = value.as_object(); + auto& dev = value.as_object(); auto seg = dev.get("seg").to_u32(); auto bus = dev.get("bus").to_u32(); auto device = dev.get("device").to_u32(); diff --git a/Userland/Utilities/mount.cpp b/Userland/Utilities/mount.cpp index fd4fed8627..d953ba7b8b 100644 --- a/Userland/Utilities/mount.cpp +++ b/Userland/Utilities/mount.cpp @@ -129,7 +129,7 @@ static bool print_mounts() VERIFY(json.has_value()); json.value().as_array().for_each([](auto& value) { - auto fs_object = value.as_object(); + auto& fs_object = value.as_object(); auto class_name = fs_object.get("class_name").to_string(); auto mount_point = fs_object.get("mount_point").to_string(); auto source = fs_object.get("source").as_string_or("none"); diff --git a/Userland/Utilities/netstat.cpp b/Userland/Utilities/netstat.cpp index c9c3162879..0c6ed913b3 100644 --- a/Userland/Utilities/netstat.cpp +++ b/Userland/Utilities/netstat.cpp @@ -123,7 +123,7 @@ int main(int argc, char** argv) }); for (auto& value : sorted_regions) { - auto if_object = value.as_object(); + auto& if_object = value.as_object(); auto bytes_in = if_object.get("bytes_in").to_string(); auto bytes_out = if_object.get("bytes_out").to_string(); @@ -174,7 +174,7 @@ int main(int argc, char** argv) }); for (auto& value : sorted_regions) { - auto if_object = value.as_object(); + auto& if_object = value.as_object(); auto local_address = if_object.get("local_address").to_string(); auto local_port = if_object.get("local_port").to_string(); diff --git a/Userland/Utilities/pmap.cpp b/Userland/Utilities/pmap.cpp index 24ae1e1636..6f3bf7b1e6 100644 --- a/Userland/Utilities/pmap.cpp +++ b/Userland/Utilities/pmap.cpp @@ -60,7 +60,7 @@ int main(int argc, char** argv) }); for (auto& value : sorted_regions) { - auto map = value.as_object(); + auto& map = value.as_object(); auto address = map.get("address").to_int(); auto size = map.get("size").to_string();