diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-09-13 12:32:19 +0100 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-09-18 18:57:28 -0700 |
commit | eacf017112d7556b3ea1d5a4e17fee0d2c0f1be8 (patch) | |
tree | 5078a9c324e27c590153328ba96666cf3b52c8de /Userland | |
parent | c8bfb07b4146ba5c560866a0c1ea6236ea1d37eb (diff) | |
download | serenity-eacf017112d7556b3ea1d5a4e17fee0d2c0f1be8.zip |
Applets/Network: Remove `include_loopback` parameter
This is always false, so we can do without it and simplify things a
little.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applets/Network/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Applets/Network/main.cpp b/Userland/Applets/Network/main.cpp index f4827196f3..44ab888505 100644 --- a/Userland/Applets/Network/main.cpp +++ b/Userland/Applets/Network/main.cpp @@ -105,7 +105,7 @@ private: m_connected = connected; } - virtual String get_adapter_info(bool include_loopback = false) + virtual String get_adapter_info() { StringBuilder adapter_info; @@ -127,16 +127,16 @@ private: return adapter_info.to_string(); int connected_adapters = 0; - json.value().as_array().for_each([&adapter_info, include_loopback, &connected_adapters](auto& value) { + json.value().as_array().for_each([&adapter_info, &connected_adapters](auto& value) { auto& if_object = value.as_object(); auto ip_address = if_object.get("ipv4_address"sv).as_string_or("no IP"); auto ifname = if_object.get("name"sv).to_string(); auto link_up = if_object.get("link_up"sv).as_bool(); auto link_speed = if_object.get("link_speed"sv).to_i32(); - if (!include_loopback) - if (ifname == "loop") - return; + if (ifname == "loop") + return; + if (ip_address != "null") connected_adapters++; |