mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-23 04:15:31 +00:00
Fix #79
This commit is contained in:
parent
c59b0b8f0d
commit
0e106df04c
2
peglib.h
2
peglib.h
@ -451,7 +451,7 @@ inline std::pair<size_t, size_t> line_info(const char* start, const char* cur) {
|
|||||||
*/
|
*/
|
||||||
#ifndef PEGLIB_NO_CONSTEXPR_SUPPORT
|
#ifndef PEGLIB_NO_CONSTEXPR_SUPPORT
|
||||||
inline constexpr unsigned int str2tag(const char* str, int h = 0) {
|
inline constexpr unsigned int str2tag(const char* str, int h = 0) {
|
||||||
return !str[h] ? 5381 : (str2tag(str, h + 1) * 33) ^ static_cast<unsigned char>(str[h]);
|
return (*str == '\0') ? h : str2tag(str + 1, (h * 33) ^ static_cast<unsigned char>(*str));
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace udl {
|
namespace udl {
|
||||||
|
Loading…
Reference in New Issue
Block a user