aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-07-15 00:43:51 +0800
committershedaniel <daniel@shedaniel.me>2020-07-15 00:43:51 +0800
commit2e880284e37a24ded2275e5e0da216c3930c42fb (patch)
tree4ee16ccf1a23f8fdafc1922d5b0afdb59613aa30 /src/main/java/me/shedaniel/rei/utils/CollectionUtils.java
parente2c264a82dc10b8e29b08225cd5bc24e689fa332 (diff)
downloadRoughlyEnoughItems-2e880284e37a24ded2275e5e0da216c3930c42fb.tar.gz
RoughlyEnoughItems-2e880284e37a24ded2275e5e0da216c3930c42fb.tar.bz2
RoughlyEnoughItems-2e880284e37a24ded2275e5e0da216c3930c42fb.zip
Performance improvements to search filtering and fix filtering not even working.
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/utils/CollectionUtils.java')
-rw-r--r--src/main/java/me/shedaniel/rei/utils/CollectionUtils.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java b/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java
index 57b8bf83c..d47d732be 100644
--- a/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java
+++ b/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java
@@ -142,7 +142,7 @@ public class CollectionUtils {
}
public static <T, R> List<R> map(List<T> list, Function<T, R> function) {
- List<R> l = new ArrayList<>(list.size());
+ List<R> l = new ArrayList<>(list.size() + 1);
for (T t : list) {
l.add(function.apply(t));
}
@@ -150,7 +150,7 @@ public class CollectionUtils {
}
public static <T, R> List<R> map(Collection<T> list, Function<T, R> function) {
- List<R> l = new ArrayList<>(list.size());
+ List<R> l = new ArrayList<>(list.size() + 1);
for (T t : list) {
l.add(function.apply(t));
}
@@ -158,7 +158,7 @@ public class CollectionUtils {
}
public static <T, R> List<R> map(T[] list, Function<T, R> function) {
- List<R> l = new ArrayList<>(list.length);
+ List<R> l = new ArrayList<>(list.length + 1);
for (T t : list) {
l.add(function.apply(t));
}