diff --git a/source/net/yacy/kelondro/index/ObjectIndexCache.java b/source/net/yacy/kelondro/index/ObjectIndexCache.java index 278125959..9bd0c4264 100644 --- a/source/net/yacy/kelondro/index/ObjectIndexCache.java +++ b/source/net/yacy/kelondro/index/ObjectIndexCache.java @@ -38,21 +38,21 @@ public final class ObjectIndexCache implements ObjectIndex, Iterable private final Row rowdef; private RowSet index0; - private RowSetArray index1; + private RowSet index1; private final Row.EntryComparator entryComparator; - private final int spread; + //private final int spread; public ObjectIndexCache(final Row rowdef, final int expectedspace) { this.rowdef = rowdef; this.entryComparator = new Row.EntryComparator(rowdef.objectOrder); - this.spread = Math.max(10, expectedspace / 3000); + //this.spread = Math.max(10, expectedspace / 3000); reset(); } public ObjectIndexCache(final Row rowdef, final int expectedspace, final int initialspace) throws RowSpaceExceededException { this.rowdef = rowdef; this.entryComparator = new Row.EntryComparator(rowdef.objectOrder); - this.spread = Math.max(10, expectedspace / 3000); + //this.spread = Math.max(10, expectedspace / 3000); reset(initialspace); } @@ -82,7 +82,7 @@ public final class ObjectIndexCache implements ObjectIndex, Iterable index0.sort(); index0.uniq(); index0.trim(false); - index1 = new RowSetArray(rowdef, spread); + index1 = new RowSet(rowdef); //new RowSetArray(rowdef, spread); } } @@ -243,7 +243,7 @@ public final class ObjectIndexCache implements ObjectIndex, Iterable // finish initialization phase index0.sort(); index0.uniq(); - index1 = new RowSetArray(rowdef, spread); + index1 = new RowSet(rowdef); //new RowSetArray(rowdef, spread); return index0.keys(up, firstKey); } assert (index1 != null); @@ -272,7 +272,7 @@ public final class ObjectIndexCache implements ObjectIndex, Iterable // finish initialization phase index0.sort(); index0.uniq(); - index1 = new RowSetArray(rowdef, spread); + index1 = new RowSet(rowdef); //new RowSetArray(rowdef, spread); return index0.rows(up, firstKey); } assert (index1 != null); @@ -306,7 +306,7 @@ public final class ObjectIndexCache implements ObjectIndex, Iterable // finish initialization phase index0.sort(); index0.uniq(); - index1 = new RowSetArray(rowdef, spread); + index1 = new RowSet(rowdef); //new RowSetArray(rowdef, spread); return index0.rows(); } assert (index1 != null); diff --git a/source/net/yacy/kelondro/order/MergeIterator.java b/source/net/yacy/kelondro/order/MergeIterator.java index 85b8e9e94..836af11c5 100644 --- a/source/net/yacy/kelondro/order/MergeIterator.java +++ b/source/net/yacy/kelondro/order/MergeIterator.java @@ -68,14 +68,14 @@ public class MergeIterator implements CloneableIterator { private void nexta() { try { - if ((a != null) && (a.hasNext())) na = a.next(); else na = null; + if (a != null && a.hasNext()) na = a.next(); else na = null; } catch (final ConcurrentModificationException e) { na = null; } } private void nextb() { try { - if ((b != null) && (b.hasNext())) nb = b.next(); else nb = null; + if (b != null && b.hasNext()) nb = b.next(); else nb = null; } catch (final ConcurrentModificationException e) { nb = null; } @@ -118,7 +118,7 @@ public class MergeIterator implements CloneableIterator { nexta(); nextb(); return s; - } else if (((up) && (c < 0)) || ((!(up)) && (c > 0))) { + } else if ((up && c < 0) || (!up && c > 0)) { s = na; nexta(); return s;