Skip to content

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

Further speed upof concurrent DHT-receive

hermensc4d0e22a773b
diff --git a/source/de/anomic/kelondro/text/ReferenceContainerCache.java b/source/de/anomic/kelondro/text/ReferenceContainerCache.java
index e5ca3c0dc..5843b4e97 100644
--- a/source/de/anomic/kelondro/text/ReferenceContainerCache.java
+++ b/source/de/anomic/kelondro/text/ReferenceContainerCache.java
@@ -427,6 +427,10 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> exte
synchronized (cache) {
ReferenceContainer<ReferenceType> containerNew = cache.put(tha, container);
if (containerNew == null) return;
+ if (container == containerNew) {
+ // The containers are the same, so nothing needs to be done
+ return;
+ }
// Now merge the smaller container into the lager.
// The other way around can become very slow
if (container.size() >= containerNew.size()) {