Skip to content

Commit

Permalink
HSEARCH-1477 Trivial optimization for empty results
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne authored and hferentschik committed Jan 8, 2014
1 parent b1a6a8f commit 7a819a6
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -272,6 +272,9 @@ public List<EntityInfo> queryEntityInfos() {
int max = max( first, queryHits.getTotalHits() );

int size = max - first + 1 < 0 ? 0 : max - first + 1;
if ( size == 0 ) {
return Collections.emptyList();
}
List<EntityInfo> infos = new ArrayList<EntityInfo>( size );
DocumentExtractor extractor = buildDocumentExtractor( searcher, queryHits, first, max );
for ( int index = first; index <= max; index++ ) {
Expand Down

0 comments on commit 7a819a6

Please sign in to comment.