Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3a2f3f4

Browse filesBrowse files
JakubOnderkamichael-grunder
authored andcommitted
Use immutable empty array in Redis::hKeys
1 parent 60b5a88 commit 3a2f3f4
Copy full SHA for 3a2f3f4

File tree

1 file changed

+6
-2
lines changed
Filter options

1 file changed

+6
-2
lines changed

‎library.c

Copy file name to clipboardExpand all lines: library.c
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3389,9 +3389,13 @@ redis_mbulk_reply_raw(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, zval
33893389
return FAILURE;
33903390
}
33913391
zval z_multi_result;
3392-
array_init_size(&z_multi_result, numElems); /* pre-allocate array for multi's results. */
33933392

3394-
redis_mbulk_reply_loop(redis_sock, &z_multi_result, numElems, UNSERIALIZE_NONE);
3393+
if (numElems < 1) {
3394+
ZVAL_EMPTY_ARRAY(&z_multi_result);
3395+
} else {
3396+
array_init_size(&z_multi_result, numElems); /* pre-allocate array for multi's results. */
3397+
redis_mbulk_reply_loop(redis_sock, &z_multi_result, numElems, UNSERIALIZE_NONE);
3398+
}
33953399

33963400
if (IS_ATOMIC(redis_sock)) {
33973401
RETVAL_ZVAL(&z_multi_result, 0, 1);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.