diff --git a/peglib.h b/peglib.h index 087e31a..49f7232 100644 --- a/peglib.h +++ b/peglib.h @@ -451,7 +451,7 @@ inline std::pair line_info(const char* start, const char* cur) { */ #ifndef PEGLIB_NO_CONSTEXPR_SUPPORT inline constexpr unsigned int str2tag(const char* str, int h = 0) { - return !str[h] ? 5381 : (str2tag(str, h + 1) * 33) ^ static_cast(str[h]); + return (*str == '\0') ? h : str2tag(str + 1, (h * 33) ^ static_cast(*str)); } namespace udl {