From 28d1087c28391c0476c64ccbf2db3d9e851fb270 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 12 May 2019 00:21:07 -0500 Subject: Use any_of for determining WLAN presence --- networkingpage.cc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/networkingpage.cc b/networkingpage.cc index e78a8f8..96903e8 100644 --- a/networkingpage.cc +++ b/networkingpage.cc @@ -63,18 +63,9 @@ int NetworkingPage::nextId() const { if(radioGroup->checkedButton() == simple) { - bool tryWireless = false; - - for(auto &iface : this->horizonWizard()->interfaces) - { - if(iface.is_wireless()) - { - tryWireless = true; - break; - } - } - - if(tryWireless) + if(std::any_of(this->horizonWizard()->interfaces.begin(), + this->horizonWizard()->interfaces.end(), + [=](Horizon::NetworkInterface &iface) { return iface.is_wireless(); })) { return HorizonWizard::Page_Network_SimpleWireless; } -- cgit v1.2.3-60-g2f50