summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-01-10 14:23:43 +0300
committerDmitry Stogov <dmitry@zend.com>2018-01-10 14:23:43 +0300
commitc533396ce4e70ba6ca74285db913b30ce8cfefda (patch)
tree1e4b66a6df5a27d339a84e337640f757c5d51559
parentd7a0d48d59d493204cd527a1b6ebf12daedb805c (diff)
downloadphp-git-c533396ce4e70ba6ca74285db913b30ce8cfefda.tar.gz
Strength reduction
-rw-r--r--Zend/zend_hash.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 50529cea3b..312b7d30e8 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -913,10 +913,12 @@ static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht,
#define ZEND_HASH_REVERSE_FOREACH(_ht, indirect) do { \
HashTable *__ht = (_ht); \
- uint32_t _idx; \
+ uint32_t _idx = __ht->nNumUsed; \
+ Bucket *_p = __ht->arData + _idx; \
+ zval *_z; \
for (_idx = __ht->nNumUsed; _idx > 0; _idx--) { \
- Bucket *_p = __ht->arData + (_idx - 1); \
- zval *_z = &_p->val; \
+ _p--; \
+ _z = &_p->val; \
if (indirect && Z_TYPE_P(_z) == IS_INDIRECT) { \
_z = Z_INDIRECT_P(_z); \
} \