From 64e7dc1d68d688634860d65e475a0f8a35a004d0 Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Tue, 20 Nov 2018 10:34:56 +0200 Subject: [PATCH] AsyncUtils.pmap() to use Collectors.toList() gitlab #207 Change-Id: I17ceafa27e6d27c7159c1698910d14b341476e1e --- .../src/org/simantics/scl/runtime/utils/AsyncUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/utils/AsyncUtils.java b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/utils/AsyncUtils.java index fcab99c20..d771a821e 100644 --- a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/utils/AsyncUtils.java +++ b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/utils/AsyncUtils.java @@ -2,7 +2,6 @@ package org.simantics.scl.runtime.utils; import java.io.PrintWriter; import java.io.StringWriter; -import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.concurrent.Callable; @@ -55,7 +54,7 @@ public class AsyncUtils { @SuppressWarnings({ "rawtypes", "unchecked" }) public static List pmap(Function f, List l) { - return Arrays.asList(l.parallelStream().map(a -> f.apply(a)).toArray()); + return l.parallelStream().map(f::apply).collect(Collectors.toList()); } @SuppressWarnings({ "rawtypes", "unchecked" }) -- 2.47.1