Skip to content

Fix performance degradation introduced in c2547ab7dc67646e287d430e44798cb9f327cf21 #9876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Zend/zend_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,15 +658,14 @@ ZEND_API void ZEND_FASTCALL zend_hash_iterators_advance(HashTable *ht, HashPosit
/* Hash must be known and precomputed before */
static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, const zend_string *key)
{
zend_ulong key_hash = ZSTR_H(key);
uint32_t nIndex;
uint32_t idx;
Bucket *p, *arData;

ZEND_ASSERT(key_hash != 0 && "Hash must be known");
ZEND_ASSERT(ZSTR_H(key) != 0 && "Hash must be known");

arData = ht->arData;
nIndex = key_hash | ht->nTableMask;
nIndex = ZSTR_H(key) | ht->nTableMask;
idx = HT_HASH_EX(arData, nIndex);

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

while (1) {
if (p->h == key_hash &&
if (p->h == ZSTR_H(key) &&
EXPECTED(p->key) &&
zend_string_equal_content(p->key, key)) {
return p;
Expand Down