diff options
author | Rosen Penev <rosenp@gmail.com> | 2020-03-26 21:29:30 -0700 |
---|---|---|
committer | Rosen Penev <rosenp@gmail.com> | 2020-04-08 14:01:12 -0700 |
commit | 015cbff93dafb17f748a20c806f4a73084a4635e (patch) | |
tree | 397288038526bf9d835ba92b00604ab51f9eb89b /src/input | |
parent | 3540cf26b1b342f175255f2dc02e615483a1383c (diff) |
[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>
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/InputPlugin.cxx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/input/InputPlugin.cxx b/src/input/InputPlugin.cxx index b682bccaa..f66af0f48 100644 --- a/src/input/InputPlugin.cxx +++ b/src/input/InputPlugin.cxx @@ -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; } |