Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.NavigableSet;
Expand Down Expand Up @@ -181,7 +182,11 @@ public void addFacetCount(BytesRef facetValue, int count) {
* @return a list of facet entries to be rendered based on the specified offset and limit
*/
public List<FacetEntry> getFacetEntries(int offset, int limit) {
List<FacetEntry> entries = new ArrayList<>();
if (offset >= facetEntries.size()) {
return Collections.emptyList();
}

List<FacetEntry> entries = new ArrayList<>(Math.min(limit, facetEntries.size() - offset));

int skipped = 0;
int included = 0;
Expand Down
Loading