mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
使用并行流,提高大量节点场景下的性能;
This commit is contained in:
parent
28f6a76933
commit
03a2579984
@ -321,7 +321,7 @@ public class EasyStream<T> extends AbstractEnhancedWrappedStream<T, EasyStream<T
|
||||
final Map<R, List<T>> pId2ChildrenMap = of(nodeList).group(pIdGetter);
|
||||
List<T> parents = ListUtil.of();
|
||||
|
||||
for (T node : nodeList) {
|
||||
of(nodeList, true).forEach(node -> {
|
||||
if (parentPredicate.test(node)) {
|
||||
parents.add(node);
|
||||
}
|
||||
@ -330,7 +330,7 @@ public class EasyStream<T> extends AbstractEnhancedWrappedStream<T, EasyStream<T
|
||||
if (children != null) {
|
||||
childrenSetter.accept(node, children);
|
||||
}
|
||||
}
|
||||
});
|
||||
return parents;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user