Skip to content

Commit f583c4d

Browse files
committed
Use 64-bit multiplication on 64-bit systems
1 parent 623b3fc commit f583c4d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Zend/zend_string.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -429,44 +429,44 @@ static zend_always_inline zend_ulong zend_inline_hash_func(const char *str, size
429429
((chunk >> (8 * 7)) & 0xff);
430430
# else
431431
hash =
432-
hash * 33 * 33 * 33 * 33 +
433-
str[0] * 33 * 33 * 33 +
434-
str[1] * 33 * 33 +
435-
str[2] * 33 +
432+
hash * Z_L(33 * 33 * 33 * 33) +
433+
str[0] * Z_L(33 * 33 * 33) +
434+
str[1] * Z_L(33 * 33) +
435+
str[2] * Z_L(33) +
436436
str[3];
437437
hash =
438-
hash * 33 * 33 * 33 * 33 +
439-
str[4] * 33 * 33 * 33 +
440-
str[5] * 33 * 33 +
441-
str[6] * 33 +
438+
hash * Z_L(33 * 33 * 33 * 33) +
439+
str[4] * Z_L(33 * 33 * 33) +
440+
str[5] * Z_L(33 * 33) +
441+
str[6] * Z_L(33) +
442442
str[7];
443443
# endif
444444
}
445445
if (len >= 4) {
446446
hash =
447-
hash * 33 * 33 * 33 * 33 +
448-
str[0] * 33 * 33 * 33 +
449-
str[1] * 33 * 33 +
450-
str[2] * 33 +
447+
hash * Z_L(33 * 33 * 33 * 33) +
448+
str[0] * Z_L(33 * 33 * 33) +
449+
str[1] * Z_L(33 * 33) +
450+
str[2] * Z_L(33) +
451451
str[3];
452452
len -= 4;
453453
str += 4;
454454
}
455455
if (len >= 2) {
456456
if (len > 2) {
457457
hash =
458-
hash * 33 * 33 * 33 +
459-
str[0] * 33 * 33 +
460-
str[1] * 33 +
458+
hash * Z_L(33 * 33 * 33) +
459+
str[0] * Z_L(33 * 33) +
460+
str[1] * Z_L(33) +
461461
str[2];
462462
} else {
463463
hash =
464-
hash * 33 * 33 +
465-
str[0] * 33 +
464+
hash * Z_L(33 * 33) +
465+
str[0] * Z_L(33) +
466466
str[1];
467467
}
468468
} else if (len != 0) {
469-
hash = hash * 33 + *str;
469+
hash = hash * Z_L(33) + *str;
470470
}
471471
#else
472472
/* variant with the hash unrolled eight times */

0 commit comments

Comments
 (0)