Skip to content

Commit

Permalink
Save needlessly collecting list in InternalMappedSignificantTerms (el…
Browse files Browse the repository at this point in the history
…astic#112502)

No need to allocate a list+stream to do an unsafe(ish) cast.
  • Loading branch information
original-brownbear committed Sep 4, 2024
1 parent 3d83538 commit 069a4d4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ protected final void writeTermTypeInfoTo(StreamOutput out) throws IOException {
}

@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public Iterator<SignificantTerms.Bucket> iterator() {
return buckets.stream().map(bucket -> (SignificantTerms.Bucket) bucket).toList().iterator();
return (Iterator) buckets.iterator();
}

@Override
Expand Down

0 comments on commit 069a4d4

Please sign in to comment.