diff options
author | Li Jin <dragon-fly@qq.com> | 2019-09-12 16:42:44 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2019-09-12 16:42:44 +0800 |
commit | 181c6e40ff8c7579d8c7fdf6c72db13ffc951c81 (patch) | |
tree | b35aac87016bdb0a8f0367ee68b7971692ff3d38 /MoonParser/parser.hpp | |
parent | 50353c1456324e7bd3c130fceaf400aed7880a41 (diff) | |
download | yuescript-181c6e40ff8c7579d8c7fdf6c72db13ffc951c81.tar.gz yuescript-181c6e40ff8c7579d8c7fdf6c72db13ffc951c81.tar.bz2 yuescript-181c6e40ff8c7579d8c7fdf6c72db13ffc951c81.zip |
cleanup.
Diffstat (limited to 'MoonParser/parser.hpp')
-rw-r--r-- | MoonParser/parser.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/MoonParser/parser.hpp b/MoonParser/parser.hpp index ae83215..a84b9a3 100644 --- a/MoonParser/parser.hpp +++ b/MoonParser/parser.hpp | |||
@@ -17,15 +17,15 @@ | |||
17 | #include <locale> | 17 | #include <locale> |
18 | 18 | ||
19 | // const str hash helper functions | 19 | // const str hash helper functions |
20 | inline constexpr std::size_t hash(char const* input) | 20 | inline constexpr size_t hash(char const* input) |
21 | { | 21 | { |
22 | return *input ? *input + 33ull * hash(input + 1) : 5381; | 22 | return *input ? *input + 33ull * hash(input + 1) : 5381; |
23 | } | 23 | } |
24 | inline std::size_t hash(const char* input, int size, int index) | 24 | inline size_t hash(const char* input, int size, int index) |
25 | { | 25 | { |
26 | return index < size ? input[index] + 33ull * hash(input, size, index + 1) : 5381; | 26 | return index < size ? input[index] + 33ull * hash(input, size, index + 1) : 5381; |
27 | } | 27 | } |
28 | inline std::size_t constexpr operator"" _id(const char* s, size_t) | 28 | inline size_t constexpr operator"" _id(const char* s, size_t) |
29 | { | 29 | { |
30 | return hash(s); | 30 | return hash(s); |
31 | } | 31 | } |