This commit is contained in:
yhirose 2020-01-23 15:51:22 -05:00
parent c59b0b8f0d
commit 0e106df04c

View File

@ -451,7 +451,7 @@ inline std::pair<size_t, size_t> 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<unsigned char>(str[h]);
return (*str == '\0') ? h : str2tag(str + 1, (h * 33) ^ static_cast<unsigned char>(*str));
}
namespace udl {