mirror of
https://github.com/redis/redis.git
synced 2026-03-23 11:13:19 -04:00
optimize reply list memory usage
This commit is contained in:
parent
54da85c2d3
commit
237a387370
1 changed files with 1 additions and 1 deletions
|
|
@ -247,7 +247,7 @@ void _addReplyStringToList(client *c, const char *s, size_t len) {
|
|||
|
||||
/* Append to this object when possible. If tail == NULL it was
|
||||
* set via addDeferredMultiBulkLength(). */
|
||||
if (tail && sdslen(tail)+len <= PROTO_REPLY_CHUNK_BYTES) {
|
||||
if (tail && (sdsavail(tail) >= len || sdslen(tail)+len <= PROTO_REPLY_CHUNK_BYTES)) {
|
||||
tail = sdscatlen(tail,s,len);
|
||||
listNodeValue(ln) = tail;
|
||||
c->reply_bytes += len;
|
||||
|
|
|
|||
Loading…
Reference in a new issue