Skip to content

Commit 94c9a47

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Fix performance degradation introduced in c2547ab
2 parents b97d2b6 + 8645657 commit 94c9a47

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Zend/zend_hash.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -658,15 +658,14 @@ ZEND_API void ZEND_FASTCALL zend_hash_iterators_advance(HashTable *ht, HashPosit
658658
/* Hash must be known and precomputed before */
659659
static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, const zend_string *key)
660660
{
661-
zend_ulong key_hash = ZSTR_H(key);
662661
uint32_t nIndex;
663662
uint32_t idx;
664663
Bucket *p, *arData;
665664

666-
ZEND_ASSERT(key_hash != 0 && "Hash must be known");
665+
ZEND_ASSERT(ZSTR_H(key) != 0 && "Hash must be known");
667666

668667
arData = ht->arData;
669-
nIndex = key_hash | ht->nTableMask;
668+
nIndex = ZSTR_H(key) | ht->nTableMask;
670669
idx = HT_HASH_EX(arData, nIndex);
671670

672671
if (UNEXPECTED(idx == HT_INVALID_IDX)) {
@@ -678,7 +677,7 @@ static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, con
678677
}
679678

680679
while (1) {
681-
if (p->h == key_hash &&
680+
if (p->h == ZSTR_H(key) &&
682681
EXPECTED(p->key) &&
683682
zend_string_equal_content(p->key, key)) {
684683
return p;

0 commit comments

Comments
 (0)