[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:
@@ -154,11 +154,7 @@ TagBuilder::CommitNew() noexcept
|
||||
bool
|
||||
TagBuilder::HasType(TagType type) const noexcept
|
||||
{
|
||||
for (auto i : items)
|
||||
if (i->type == type)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return std::any_of(items.begin(), items.end(), [type](const auto &i) { return i->type == type; });
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user