From 0e53dd642c44a613fdc1fa683ea373516e67c983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 28 Sep 2022 15:59:08 +0200 Subject: Fix MSVC warning C4706: assignment within conditional expression Part of #66537. --- core/templates/hashfuncs.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/templates') 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; -- cgit v1.2.3