Skip to content

Commit

Permalink
bugfix for 100% CPU bug; thanks to Matthias for analysis
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1926 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Mar 18, 2006
1 parent 254a13e commit f16f1f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/de/anomic/plasma/plasmaWordIndex.java
Expand Up @@ -383,10 +383,14 @@ public synchronized TreeSet wordHashSet(String startHash, int resourceLevel, boo
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;
}
Expand Down

0 comments on commit f16f1f1

Please sign in to comment.