From 20d74bb07e542e4a49e845dfff5bc6e6a6167377 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 17 Aug 2021 20:13:40 -0700 Subject: [PATCH] clang-tidy: replace loop with std::all_of Found with readability-use-anyofallof Signed-off-by: Rosen Penev --- src/output/plugins/snapcast/SnapcastOutputPlugin.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/output/plugins/snapcast/SnapcastOutputPlugin.cxx b/src/output/plugins/snapcast/SnapcastOutputPlugin.cxx index 239806122..b6fd6f844 100644 --- a/src/output/plugins/snapcast/SnapcastOutputPlugin.cxx +++ b/src/output/plugins/snapcast/SnapcastOutputPlugin.cxx @@ -367,11 +367,7 @@ SnapcastOutput::IsDrained() const noexcept if (!chunks.empty()) return false; - for (const auto &client : clients) - if (!client.IsDrained()) - return false; - - return true; + return std::all_of(clients.begin(), clients.end(), [](auto&& c){ return c.IsDrained(); }); } void