aboutsummaryrefslogtreecommitdiff
path: root/MoonParser/parser.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'MoonParser/parser.hpp')
-rw-r--r--MoonParser/parser.hpp6
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
20inline constexpr std::size_t hash(char const* input) 20inline 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}
24inline std::size_t hash(const char* input, int size, int index) 24inline 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}
28inline std::size_t constexpr operator"" _id(const char* s, size_t) 28inline size_t constexpr operator"" _id(const char* s, size_t)
29{ 29{
30 return hash(s); 30 return hash(s);
31} 31}