summaryrefslogtreecommitdiff
path: root/ext/standard/array.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-01-22 14:14:35 +0300
committerDmitry Stogov <dmitry@zend.com>2018-01-22 14:14:35 +0300
commitebf900a9ebde4db89802009444e23bf2920f073c (patch)
tree1eaa5254046c1ea81cc852fc1064cd8413e85a8c /ext/standard/array.c
parentc75346dcb55d9f28e3e44b15ce4476d4bcc73731 (diff)
downloadphp-git-ebf900a9ebde4db89802009444e23bf2920f073c.tar.gz
Introduce mcros to access HashTable iterators counter
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r--ext/standard/array.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index d6832856b8..3ebf073d11 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2989,7 +2989,7 @@ static void php_array_data_shuffle(zval *array) /* {{{ */
hash = Z_ARRVAL_P(array);
n_left = n_elems;
- if (EXPECTED(hash->u.v.nIteratorsCount == 0)) {
+ if (EXPECTED(!HT_HAS_ITERATORS(hash))) {
if (hash->nNumUsed != hash->nNumOfElements) {
for (j = 0, idx = 0; idx < hash->nNumUsed; idx++) {
p = hash->arData + idx;
@@ -3190,7 +3190,7 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
}
/* replace HashTable data */
- in_hash->u.v.nIteratorsCount = 0;
+ HT_SET_ITERATORS_COUNT(in_hash, 0);
in_hash->pDestructor = NULL;
zend_hash_destroy(in_hash);
@@ -3345,7 +3345,7 @@ PHP_FUNCTION(array_shift)
if (HT_FLAGS(Z_ARRVAL_P(stack)) & HASH_FLAG_PACKED) {
uint32_t k = 0;
- if (EXPECTED(Z_ARRVAL_P(stack)->u.v.nIteratorsCount == 0)) {
+ if (EXPECTED(!HT_HAS_ITERATORS(Z_ARRVAL_P(stack)))) {
for (idx = 0; idx < Z_ARRVAL_P(stack)->nNumUsed; idx++) {
p = Z_ARRVAL_P(stack)->arData + idx;
if (Z_TYPE(p->val) == IS_UNDEF) continue;
@@ -3428,7 +3428,7 @@ PHP_FUNCTION(array_unshift)
Z_TRY_ADDREF(args[i]);
zend_hash_next_index_insert_new(&new_hash, &args[i]);
}
- if (EXPECTED(Z_ARRVAL_P(stack)->u.v.nIteratorsCount == 0)) {
+ if (EXPECTED(!HT_HAS_ITERATORS(Z_ARRVAL_P(stack)))) {
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(stack), key, value) {
if (key) {
zend_hash_add_new(&new_hash, key, value);
@@ -3457,7 +3457,7 @@ PHP_FUNCTION(array_unshift)
}
/* replace HashTable data */
- Z_ARRVAL_P(stack)->u.v.nIteratorsCount = 0;
+ HT_SET_ITERATORS_COUNT(Z_ARRVAL_P(stack), 0);
Z_ARRVAL_P(stack)->pDestructor = NULL;
zend_hash_destroy(Z_ARRVAL_P(stack));