summaryrefslogtreecommitdiffstats
path: root/include/raul/Symbol.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-01-02 14:50:28 +0100
committerDavid Robillard <d@drobilla.net>2021-01-02 14:50:28 +0100
commitd7be2c60100c794caeddb5b4e8acbed43fa3df26 (patch)
tree6c309a890021dffc0ca8193c68deec7e85541b36 /include/raul/Symbol.hpp
parent7dcc8ae2ea9f089cb410cb6dec39f3117427a1d4 (diff)
downloadraul-d7be2c60100c794caeddb5b4e8acbed43fa3df26.tar.gz
raul-d7be2c60100c794caeddb5b4e8acbed43fa3df26.tar.bz2
raul-d7be2c60100c794caeddb5b4e8acbed43fa3df26.zip
Use std::all_of
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.