summaryrefslogtreecommitdiff
path: root/core/templates
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-28 15:59:08 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-28 16:05:07 +0200
commit0e53dd642c44a613fdc1fa683ea373516e67c983 (patch)
treed3487cf419097a504dc884ddeb937bf9eca70c24 /core/templates
parent14e1f36e614686f3fea0c74fac3624d1027dd5cc (diff)
Fix MSVC warning C4706: assignment within conditional expression
Part of #66537.
Diffstat (limited to 'core/templates')
-rw-r--r--core/templates/hashfuncs.h5
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;