From 0248a6b125df10ab74de3db82bc348cc4a6dce63 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 29 Sep 2017 16:16:19 +0200 Subject: [PATCH] Streams: fix streamTrimByLength() standalone items skipping. --- src/t_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/t_stream.c b/src/t_stream.c index a7505d15..4365aa47 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -383,7 +383,7 @@ int64_t streamTrimByLength(stream *s, size_t maxlen, int approx) { if (flags & STREAM_ITEM_FLAG_SAMEFIELDS) { to_skip = master_fields_count; } else { - to_skip = lpGetInteger(p); p = lpNext(lp,p); + to_skip = lpGetInteger(p); to_skip = 1+(to_skip*2); }