diff options
author | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2016-11-14 15:03:26 +0300 |
---|---|---|
committer | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2016-11-14 21:52:51 +0300 |
commit | f5ddf53b79f3bf61b66ce800a119fcf61c3762c9 (patch) | |
tree | 7e028d750ac87cc0e059a27e2968ba3a344f6260 /cluster_library.c | |
parent | cecbeb7d599ccdc34a03e63b846ef27a20ea7fa4 (diff) |
php7 compatibility
The 'l' specifier now expects a zend_long instead of a long
for zend_parse_parameters.
Diffstat (limited to 'cluster_library.c')
-rw-r--r-- | cluster_library.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/cluster_library.c b/cluster_library.c index 2b3a31b7..99017545 100644 --- a/cluster_library.c +++ b/cluster_library.c @@ -862,7 +862,7 @@ PHP_REDIS_API void cluster_free(redisCluster *c) { /* Takes our input hash table and returns a straigt C array with elements, * which have been randomized. The return value needs to be freed. */ static zval **cluster_shuffle_seeds(HashTable *seeds, int *len) { - zval **z_seeds; + zval **z_seeds, *z_ele; int *map, i, count, index=0; /* How many */ @@ -877,12 +877,9 @@ static zval **cluster_shuffle_seeds(HashTable *seeds, int *len) { fyshuffle(map, count); /* Iterate over our source array and use our map to create a random list */ - for (zend_hash_internal_pointer_reset(seeds); - zend_hash_has_more_elements(seeds) == SUCCESS; - zend_hash_move_forward(seeds)) - { - z_seeds[map[index++]] = zend_hash_get_current_data(seeds); - } + ZEND_HASH_FOREACH_VAL(seeds, z_ele) { + z_seeds[map[index++]] = z_ele; + } ZEND_HASH_FOREACH_END(); efree(map); |