diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/.clang-tidy | 1 | ||||
-rw-r--r-- | include/raul/Symbol.hpp | 9 |
2 files changed, 2 insertions, 8 deletions
diff --git a/include/.clang-tidy b/include/.clang-tidy index 6bc88d2..05349dd 100644 --- a/include/.clang-tidy +++ b/include/.clang-tidy @@ -20,7 +20,6 @@ Checks: > -llvmlibc-*, -modernize-use-trailing-return-type, -readability-implicit-bool-conversion, - -readability-use-anyofallof, CheckOptions: - key: modernize-use-override.AllowOverrideAndFinal value: 'true' diff --git a/include/raul/Symbol.hpp b/include/raul/Symbol.hpp index 30917b5..5794440 100644 --- a/include/raul/Symbol.hpp +++ b/include/raul/Symbol.hpp @@ -18,6 +18,7 @@ #include "raul/Exception.hpp" +#include <algorithm> #include <cstddef> #include <string> @@ -99,13 +100,7 @@ public: return false; // Must start with a letter or underscore } - for (auto c : str) { - if (!is_valid_char(c)) { - return false; // All characters must be _, a-z, A-Z, 0-9 - } - } - - return true; + return std::all_of(str.begin(), str.end(), is_valid_char); } /** Convert a string to a valid symbol. |