bugfix for 100% CPU bug; thanks to Matthias for analysis

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1926 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 254a13efd9
commit f16f1f15cd

@ -383,10 +383,14 @@ public final class plasmaWordIndex {
hashOrder.rotate(startHash.getBytes());
TreeSet hashes = new TreeSet(hashOrder);
Iterator i = wordHashes(startHash, resourceLevel, rot);
if (resourceLevel == plasmaWordIndex.RL_RAMCACHE) count = Math.min(ramCache.wSize(), count);
String hash;
while ((hashes.size() < count) && (i.hasNext())) {
while ((count > 0) && (i.hasNext())) {
hash = (String) i.next();
if ((hash != null) && (hash.length() > 0)) hashes.add(hash);
if ((hash != null) && (hash.length() > 0)) {
hashes.add(hash);
count--;
}
}
return hashes;
}

Loading…
Cancel
Save