summaryrefslogtreecommitdiffstats
path: root/include/raul/Symbol.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/raul/Symbol.hpp')
-rw-r--r--include/raul/Symbol.hpp9
1 files changed, 2 insertions, 7 deletions
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.