LUCENE-3471: move comment up

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1176479 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2011-09-27 17:21:54 +00:00
parent 09c2d563f1
commit 4915dcc3f3
1 changed files with 1 additions and 1 deletions

View File

@ -752,11 +752,11 @@ public class IndexSearcher implements Closeable {
public TopDocs call() throws IOException { public TopDocs call() throws IOException {
final TopDocs docs = searcher.search (slice.leaves, weight, filter, after, nDocs); final TopDocs docs = searcher.search (slice.leaves, weight, filter, after, nDocs);
final ScoreDoc[] scoreDocs = docs.scoreDocs; final ScoreDoc[] scoreDocs = docs.scoreDocs;
//it would be so nice if we had a thread-safe insert
lock.lock(); lock.lock();
try { try {
for (int j = 0; j < scoreDocs.length; j++) { // merge scoreDocs into hq for (int j = 0; j < scoreDocs.length; j++) { // merge scoreDocs into hq
final ScoreDoc scoreDoc = scoreDocs[j]; final ScoreDoc scoreDoc = scoreDocs[j];
//it would be so nice if we had a thread-safe insert
if (scoreDoc == hq.insertWithOverflow(scoreDoc)) { if (scoreDoc == hq.insertWithOverflow(scoreDoc)) {
break; break;
} }