From f06162c1bda98554e7da9896979c7ecbbd8584bd Mon Sep 17 00:00:00 2001 From: Zjp <1215582715@qq.com> Date: Mon, 1 Aug 2022 17:16:14 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84?= =?UTF-8?q?=E5=B9=B6=E8=A1=8C=E6=B5=81=E8=AE=BE=E7=BD=AE,=20=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E7=BC=BA=E5=A4=B1=E7=9A=84=E8=AE=BE=E7=BD=AE;=202.?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E4=BB=A3=E7=A0=81;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/hutool/core/stream/FastStream.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hutool-core/src/main/java/cn/hutool/core/stream/FastStream.java b/hutool-core/src/main/java/cn/hutool/core/stream/FastStream.java index fad246885..0916995bf 100644 --- a/hutool-core/src/main/java/cn/hutool/core/stream/FastStream.java +++ b/hutool-core/src/main/java/cn/hutool/core/stream/FastStream.java @@ -538,10 +538,10 @@ public class FastStream implements Stream, Iterable { // 第一次出现的key返回true return null == exists.putIfAbsent(key, Boolean.TRUE); } - })).parallel(isParallel()); + })).parallel(); } else { Set exists = new HashSet<>(); - return of(stream.filter(e -> exists.add(keyExtractor.apply(e)))).parallel(isParallel()); + return of(stream.filter(e -> exists.add(keyExtractor.apply(e)))); } } @@ -1004,7 +1004,7 @@ public class FastStream implements Stream, Iterable { public FastStream reverse() { List list = toList(); Collections.reverse(list); - return FastStream.of(list, isParallel()); + return of(list, isParallel()); } /** @@ -1403,7 +1403,9 @@ public class FastStream implements Stream, Iterable { if (isParallel()) { resStream = toList().stream(); } - return of(resStream.map(e -> zipper.apply(e, iterator.hasNext() ? iterator.next() : null))); + final FastStream newStream = of(resStream.map(e -> zipper.apply(e, iterator.hasNext() ? iterator.next() : null))); + newStream.parallel(isParallel()); + return newStream; } /**