From 2b734a7ec429825c7007c1093883229e069d36c7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 8 Jul 2019 15:48:59 +0200 Subject: Apply various suggestions by cppcheck Reported-By: cppcheck --- apt-pkg/contrib/hashes.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'apt-pkg/contrib/hashes.cc') diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index d03fb6083..366133b02 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -169,10 +169,7 @@ bool HashStringList::usable() const /*{{{*/ if (forcedType.empty() == true) { // See if there is at least one usable hash - for (auto const &hs: list) - if (hs.usable()) - return true; - return false; + return std::any_of(list.begin(), list.end(), [](auto const &hs) { return hs.usable(); }); } return find(forcedType) != NULL; } -- cgit v1.2.3