diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-28 15:59:08 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-28 16:05:07 +0200 |
commit | 0e53dd642c44a613fdc1fa683ea373516e67c983 (patch) | |
tree | d3487cf419097a504dc884ddeb937bf9eca70c24 /core/templates | |
parent | 14e1f36e614686f3fea0c74fac3624d1027dd5cc (diff) |
Fix MSVC warning C4706: assignment within conditional expression
Part of #66537.
Diffstat (limited to 'core/templates')
-rw-r--r-- | core/templates/hashfuncs.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/templates/hashfuncs.h b/core/templates/hashfuncs.h index d85cdf7adc..456a7b01ed 100644 --- a/core/templates/hashfuncs.h +++ b/core/templates/hashfuncs.h @@ -61,10 +61,11 @@ static _FORCE_INLINE_ uint32_t hash_djb2(const char *p_cstr) { const unsigned char *chr = (const unsigned char *)p_cstr; uint32_t hash = 5381; - uint32_t c; + uint32_t c = *chr++; - while ((c = *chr++)) { + while (c) { hash = ((hash << 5) + hash) ^ c; /* hash * 33 ^ c */ + c = *chr++; } return hash; |