fix for missing topLevelClone in indexRAMCacheRI.wordContainerIterator

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2340 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent e357599f92
commit 0b7112f8b2

@ -290,12 +290,10 @@ public final class indexRAMCacheRI extends indexAbstractRI implements indexRI {
private boolean rot;
private Iterator iterator;
private String startHash;
public wordContainerIterator(String startWordHash, boolean rot) {
this.rot = rot;
this.startHash = startWordHash;
this.iterator = wCache.tailMap(startWordHash).values().iterator();
this.iterator = (startWordHash == null) ? wCache.values().iterator() : wCache.tailMap(startWordHash).values().iterator();
// The collection's iterator will return the values in the order that their corresponding keys appear in the tree.
}
@ -306,12 +304,12 @@ public final class indexRAMCacheRI extends indexAbstractRI implements indexRI {
public Object next() {
if (iterator.hasNext()) {
return iterator.next();
return ((indexContainer) iterator.next()).topLevelClone();
} else {
// rotation iteration
if (rot) {
iterator = wCache.tailMap(startHash).values().iterator();
return iterator.next();
iterator = wCache.values().iterator();
return ((indexContainer) iterator.next()).topLevelClone();
} else {
return null;
}

Loading…
Cancel
Save