aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-04-24 09:15:58 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-04-24 09:19:23 +0200
commit06cd3b2c0e6d7e0a8eb6f495f932068120cd3dab (patch)
treefae9668812169e009c0a7aad46e1593b28cbd763 /main/src/cgeo/geocaching/utils
parent0fa22217a447ff4191e4e3b8a6d8932d86f91863 (diff)
downloadcgeo-06cd3b2c0e6d7e0a8eb6f495f932068120cd3dab.zip
cgeo-06cd3b2c0e6d7e0a8eb6f495f932068120cd3dab.tar.gz
cgeo-06cd3b2c0e6d7e0a8eb6f495f932068120cd3dab.tar.bz2
Revert "fix #3759: OOM while loading caches"
This reverts commit 2f3e8ddd18303123a1b81995357f27461fa1d586, as the symptom of the out of memory error might not be its cause, and it slows down the loading of lists.
Diffstat (limited to 'main/src/cgeo/geocaching/utils')
-rw-r--r--main/src/cgeo/geocaching/utils/MiscUtils.java40
1 files changed, 0 insertions, 40 deletions
diff --git a/main/src/cgeo/geocaching/utils/MiscUtils.java b/main/src/cgeo/geocaching/utils/MiscUtils.java
deleted file mode 100644
index 122c4eb..0000000
--- a/main/src/cgeo/geocaching/utils/MiscUtils.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package cgeo.geocaching.utils;
-
-import org.apache.commons.collections4.iterators.IteratorIterable;
-import org.apache.commons.lang3.NotImplementedException;
-
-import java.util.Iterator;
-import java.util.List;
-
-final public class MiscUtils {
-
- private MiscUtils() {} // Do not instantiate
-
- public static <T> Iterable<List<T>> buffer(final List<T> original, final int n) {
- if (n <= 0) {
- throw new IllegalArgumentException("buffer size must be positive");
- }
- return new IteratorIterable<List<T>>(new Iterator<List<T>>() {
- final int size = original.size();
- int next = 0;
-
- @Override
- public boolean hasNext() {
- return next < size;
- }
-
- @Override
- public List<T> next() {
- final List<T> result = original.subList(next, Math.min(next + n, size));
- next += n;
- return result;
- }
-
- @Override
- public void remove() {
- throw new NotImplementedException("remove");
- }
- });
- }
-
-}