Skip to content

Commit 58038f7

Browse files
committed
Nit stream use in generated collections
1 parent cb4ae51 commit 58038f7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

collections-generator/src/main/java/org/neo4j/gds/collections/hsa/HugeSparseArrayTestGenerator.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import java.util.concurrent.Executors;
3232
import java.util.concurrent.ThreadLocalRandom;
3333
import java.util.concurrent.atomic.AtomicLong;
34-
import java.util.stream.Collectors;
3534
import java.util.stream.IntStream;
3635

3736
import static org.neo4j.gds.collections.TestGeneratorUtils.ASSERTJ_ASSERTIONS;
@@ -235,16 +234,12 @@ private static MethodSpec shouldSetParallel(TypeName valueType, TypeName element
235234
" for (long idx = start; idx < end; idx++) {\n" +
236235
" builder.set(idx, $L);\n" +
237236
" }\n" +
238-
"}).collect($T.toList());",
237+
"}).toList()",
239238
IntStream.class,
240239
Runnable.class,
241-
variableValue(valueType, "threadId"),
242-
Collectors.class
243-
)
244-
.addStatement(
245-
"var futures = tasks.stream().map(executor::submit).collect($T.toList())",
246-
Collectors.class
240+
variableValue(valueType, "threadId")
247241
)
242+
.addStatement("var futures = tasks.stream().map(executor::submit).toList()")
248243
.beginControlFlow("for (var future : futures)")
249244
.addStatement("future.get()")
250245
.endControlFlow()

0 commit comments

Comments
 (0)