From 3a8b8d8a0b7eae59ef9d5e6187690360edd082a6 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Wed, 4 Aug 2021 12:56:09 +0200 Subject: [PATCH] SystemMonitor: Remove unused `this` lambda captures This fixes an `unused-lambda-capture` warning emitted by Clang, and reduces the size of the produced lambda object. --- .../Applications/SystemMonitor/NetworkStatisticsWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/SystemMonitor/NetworkStatisticsWidget.cpp b/Userland/Applications/SystemMonitor/NetworkStatisticsWidget.cpp index ec580f790f..c27b7b6c57 100644 --- a/Userland/Applications/SystemMonitor/NetworkStatisticsWidget.cpp +++ b/Userland/Applications/SystemMonitor/NetworkStatisticsWidget.cpp @@ -49,7 +49,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget() net_adapters_fields.empend("class_name", "Class", Gfx::TextAlignment::CenterLeft); net_adapters_fields.empend("mac_address", "MAC", Gfx::TextAlignment::CenterLeft); net_adapters_fields.empend("Link status", Gfx::TextAlignment::CenterLeft, - [this](JsonObject const& object) -> String { + [](JsonObject const& object) -> String { if (!object.get("link_up").as_bool()) return "Down"; @@ -57,7 +57,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget() object.get("link_full_duplex").as_bool() ? "full" : "half"); }); net_adapters_fields.empend("IPv4", Gfx::TextAlignment::CenterLeft, - [this](JsonObject const& object) -> String { + [](JsonObject const& object) -> String { return object.get("ipv4_address").as_string_or(""); }); net_adapters_fields.empend("packets_in", "Pkt In", Gfx::TextAlignment::CenterRight);