added a double-check for search results

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4432 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent a1e9e6e2e6
commit 96c5e6acc7

@ -531,12 +531,21 @@ public final class plasmaSearchEvent {
//System.out.println("+++DEBUG-resultWorker+++ fetched " + resultEntry.urlstring()); //System.out.println("+++DEBUG-resultWorker+++ fetched " + resultEntry.urlstring());
// place the result to the result vector // place the result to the result vector
boolean d = false;
synchronized (resultList) { synchronized (resultList) {
resultList.add(resultEntry); doublecheck: for (int i = 0; i < resultList.size(); i++) {
if (resultList.get(i).urlcomps.url().hash().equals(resultEntry.urlcomps.url().hash())) {
d = true;
break doublecheck;
}
}
if (!d) {
resultList.add(resultEntry);
}
} }
// add references // add references
synchronized (rankedCache) { if (!d) synchronized (rankedCache) {
rankedCache.addReferences(resultEntry); rankedCache.addReferences(resultEntry);
} }
//System.out.println("DEBUG SNIPPET_LOADING: thread " + id + " got " + resultEntry.url()); //System.out.println("DEBUG SNIPPET_LOADING: thread " + id + " got " + resultEntry.url());

Loading…
Cancel
Save