Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Fix for http://forum.yacy-websuche.de/viewtopic.php?f=6&t=2334
hermens2fbc0696bf98
diff --git a/source/de/anomic/kelondro/text/ReferenceContainerCache.java b/source/de/anomic/kelondro/text/ReferenceContainerCache.javaindex 51f2aa529..e5ca3c0dc 100644--- a/source/de/anomic/kelondro/text/ReferenceContainerCache.java+++ b/source/de/anomic/kelondro/text/ReferenceContainerCache.java@@ -427,8 +427,15 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> extesynchronized (cache) {ReferenceContainer<ReferenceType> containerNew = cache.put(tha, container);if (containerNew == null) return;- container.putAllRecent(containerNew);- cache.put(tha, container);+ // Now merge the smaller container into the lager.+ // The other way around can become very slow+ if (container.size() >= containerNew.size()) {+ container.putAllRecent(containerNew);+ cache.put(tha, container);+ } else {+ containerNew.putAllRecent(container);+ cache.put(tha, containerNew);+ }}}