mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
parent
5bd46d33db
commit
e1b8b4b6da
@ -4380,6 +4380,11 @@ void clusterCommand(client *c) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Avoid allocating more than needed in case of large COUNT argument
|
||||
* and smaller actual number of keys. */
|
||||
unsigned int keys_in_slot = countKeysInSlot(slot);
|
||||
if (maxkeys > keys_in_slot) maxkeys = keys_in_slot;
|
||||
|
||||
keys = zmalloc(sizeof(robj*)*maxkeys);
|
||||
numkeys = getKeysInSlot(slot, keys, maxkeys);
|
||||
addReplyMultiBulkLen(c,numkeys);
|
||||
|
Loading…
x
Reference in New Issue
Block a user