[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:
@@ -127,12 +127,7 @@ gcc_pure
|
||||
static bool
|
||||
IsValidValue(const StringView s) noexcept
|
||||
{
|
||||
for (const char ch : s) {
|
||||
if ((unsigned char)ch < 0x20)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return std::none_of(s.begin(), s.end(), [](const auto &ch) { return (unsigned char)ch < 0x20; });
|
||||
}
|
||||
|
||||
class PrintCommentHandler final : public NullTagHandler {
|
||||
|
Reference in New Issue
Block a user