Simplified checks

This commit is contained in:
Martijn van Groningen 2013-08-08 11:33:06 +02:00
parent c7d5881686
commit d450d3b016
2 changed files with 2 additions and 6 deletions

View File

@ -100,9 +100,7 @@ public class PercolatorService extends AbstractComponent {
}
if (collector.exists()) {
if (!context.limit) {
matches.add(entry.getKey());
} else if (count < context.size) {
if (!context.limit || count < context.size) {
matches.add(entry.getKey());
}
count++;

View File

@ -99,9 +99,7 @@ abstract class QueryCollector extends Collector {
collector.reset();
searcher.search(query, collector);
if (collector.exists()) {
if (!limit) {
matches.add(id);
} else if (counter < size) {
if (!limit || counter < size) {
matches.add(id);
}
counter++;