Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) avoiding to search in the treemap two times for the same key

theli408de3beee33
diff --git a/source/de/anomic/plasma/plasmaWordIndexCache.java b/source/de/anomic/plasma/plasmaWordIndexCache.java
index 240c4ec89..cefce6443 100644
--- a/source/de/anomic/plasma/plasmaWordIndexCache.java
+++ b/source/de/anomic/plasma/plasmaWordIndexCache.java
@@ -364,13 +364,11 @@ public final class plasmaWordIndexCache implements plasmaWordIndexInterface {
plasmaWordIndexEntryContainer container = null;
long time;
synchronized (cache) {
- // get the container
- container = (plasmaWordIndexEntryContainer) cache.get(key);
+ // get the container and remove it from the cache
+ container = (plasmaWordIndexEntryContainer) this.cache.remove(key);
if (container == null) return 0; // flushing of nonexisting key
time = getUpdateTime(key);
- // remove it from the cache
- cache.remove(key);
hashScore.deleteScore(key);
hashDate.deleteScore(key);
}