summaryrefslogtreecommitdiff
path: root/Userland/Applets/Network
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-04-16 19:58:36 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-17 01:27:29 +0200
commit73aa59ccf1f844588e3ba6edbdd3520ccf640768 (patch)
tree48cd10f579e3b2c67906bc11c35edb204221ee06 /Userland/Applets/Network
parentd33fdc925b0590cd866c0dbf1d74094457e0aaae (diff)
downloadserenity-73aa59ccf1f844588e3ba6edbdd3520ccf640768.zip
Network.Applet: Avoid JsonObject copy and use StringBuilder::appendff()
Diffstat (limited to 'Userland/Applets/Network')
-rw-r--r--Userland/Applets/Network/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Applets/Network/main.cpp b/Userland/Applets/Network/main.cpp
index 1d359e80d3..bd9b71b80b 100644
--- a/Userland/Applets/Network/main.cpp
+++ b/Userland/Applets/Network/main.cpp
@@ -141,7 +141,7 @@ private:
int connected_adapters = 0;
json.value().as_array().for_each([&adapter_info, include_loopback, &connected_adapters](auto& value) {
- auto if_object = value.as_object();
+ auto& if_object = value.as_object();
auto ip_address = if_object.get("ipv4_address").to_string();
auto ifname = if_object.get("name").to_string();
@@ -151,7 +151,7 @@ private:
if (ip_address != "null")
connected_adapters++;
- adapter_info.appendf("%s: %s\n", ifname.characters(), ip_address.characters());
+ adapter_info.appendff("{}: {}\n", ifname, ip_address);
});
// show connected icon so long as at least one adapter is connected