Skip to content

Commit 2f2ca21

Browse files
committed
refactor: use std::ranges::any_of in has_enabled_clients
1 parent 2fa6c51 commit 2f2ca21

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/nvhttp.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,12 +1252,7 @@ namespace nvhttp {
12521252
}
12531253

12541254
bool has_enabled_clients() {
1255-
for (const auto &named_cert : client_root.named_devices) {
1256-
if (named_cert.enabled) {
1257-
return true;
1258-
}
1259-
}
1260-
return false;
1255+
return std::ranges::any_of(client_root.named_devices, [](const auto &c) { return c.enabled; });
12611256
}
12621257

12631258
bool is_client_enabled(const std::string_view cert_pem) {

0 commit comments

Comments
 (0)