From 78a272f3e229b1d2ea6789992d3ccaf722bb8781 Mon Sep 17 00:00:00 2001 From: Tihomir Mateev Date: Fri, 18 Oct 2024 19:18:35 +0300 Subject: [PATCH] Initialize with -1 to avoid hitting the sizing issue --- src/main/java/io/lettuce/core/ScanIterator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/lettuce/core/ScanIterator.java b/src/main/java/io/lettuce/core/ScanIterator.java index d3b617d240..0e8e26e81c 100644 --- a/src/main/java/io/lettuce/core/ScanIterator.java +++ b/src/main/java/io/lettuce/core/ScanIterator.java @@ -341,7 +341,7 @@ private ScoredValueScanCursor getNextScanCursor(ScanCursor scanCursor) { * @return a {@link Stream} for this {@link ScanIterator}. */ public Stream stream() { - return StreamSupport.stream(Spliterators.spliterator(this, 0, 0), false); + return StreamSupport.stream(Spliterators.spliterator(this, -1, 0), false); } /**