From 8a4261b64b3a108483c5cc66bce673968c0e29a3 Mon Sep 17 00:00:00 2001 From: Roman / Nea Date: Thu, 17 Feb 2022 06:56:51 +0100 Subject: Remove unused scan function --- .../io/github/moulberry/notenoughupdates/util/Utils.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index 00a6e5f4..f09883eb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -48,8 +48,6 @@ import java.nio.FloatBuffer; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.*; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.BiFunction; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -1476,15 +1474,4 @@ public class Utils { return left <= x && x <= left + width && top <= y && y <= top + height; } - - public static List runningReduce(Iterable values, U initial, BiFunction reducer) { - Spliterator spliterator = values.spliterator(); - long size = spliterator.estimateSize(); - List rets = new ArrayList<>(Math.toIntExact(size == Long.MAX_VALUE ? 0 : size)); - AtomicReference acc = new AtomicReference<>(initial); - spliterator.forEachRemaining(it -> { - acc.getAndUpdate(value -> reducer.apply(it, value)); - }); - return rets; - } } -- cgit