mirror of
https://github.com/php-win-ext/phpredis.git
synced 2026-03-24 00:52:16 +01:00
Use immutable empty array in Redis::hKeys
This commit is contained in:
committed by
Michael Grunder
parent
60b5a8860a
commit
3a2f3f45fc
@@ -3389,9 +3389,13 @@ redis_mbulk_reply_raw(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, zval
|
||||
return FAILURE;
|
||||
}
|
||||
zval z_multi_result;
|
||||
array_init_size(&z_multi_result, numElems); /* pre-allocate array for multi's results. */
|
||||
|
||||
redis_mbulk_reply_loop(redis_sock, &z_multi_result, numElems, UNSERIALIZE_NONE);
|
||||
if (numElems < 1) {
|
||||
ZVAL_EMPTY_ARRAY(&z_multi_result);
|
||||
} else {
|
||||
array_init_size(&z_multi_result, numElems); /* pre-allocate array for multi's results. */
|
||||
redis_mbulk_reply_loop(redis_sock, &z_multi_result, numElems, UNSERIALIZE_NONE);
|
||||
}
|
||||
|
||||
if (IS_ATOMIC(redis_sock)) {
|
||||
RETVAL_ZVAL(&z_multi_result, 0, 1);
|
||||
|
||||
Reference in New Issue
Block a user