[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:
@@ -33,11 +33,8 @@ InputPlugin::SupportsUri(const char *uri) const noexcept
|
||||
if (StringStartsWithIgnoreCase(uri, *i))
|
||||
return true;
|
||||
} else {
|
||||
for (const auto& schema : protocols()) {
|
||||
if (StringStartsWithIgnoreCase(uri, schema.c_str())){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return std::any_of(protocols().begin(), protocols().end(), [uri](const auto &schema)
|
||||
{ return StringStartsWithIgnoreCase(uri, schema.c_str()); } );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user