[cppcheck] convert several functions to use std::all_of

std::all_of becomes constexpr in C++20. I'm not sure it results in better
performance.

Found with useStlAlgorithm

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-03-26 21:29:30 -07:00
parent 3540cf26b1
commit 015cbff93d
7 changed files with 12 additions and 36 deletions

View File

@@ -113,11 +113,7 @@ public:
#ifndef NDEBUG
gcc_pure
bool IsEmpty() const noexcept {
for (const auto &c : list)
if (!c.IsCancelled())
return false;
return true;
return std::all_of(list.begin(), list.end(), [](const auto &c) { return c.IsCancelled(); });
}
#endif