summaryrefslogtreecommitdiff
path: root/Userland/Utilities/netstat.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-05-31 17:59:02 +0100
committerLinus Groh <mail@linusgroh.de>2021-05-31 17:59:02 +0100
commit16d51d78c0ca292a12cc27fe0766fa86df25d8a9 (patch)
tree620dd1347e25e0cab03d74733da9f3b70492302c /Userland/Utilities/netstat.cpp
parenta6248101e2fea4e2cdb73fac7158ad1e549eff16 (diff)
downloadserenity-16d51d78c0ca292a12cc27fe0766fa86df25d8a9.zip
Userland: Avoid a bunch of JsonObject copies
JsonValue::as_object() returns a reference.
Diffstat (limited to 'Userland/Utilities/netstat.cpp')
-rw-r--r--Userland/Utilities/netstat.cpp4
1 files changed, 2 insertions, 2 deletions
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();