Consider avoiding the use of a pre-sized builder for the FilteredCollection
in Maps#uniqueIndex
#6638
Labels
FilteredCollection
in Maps#uniqueIndex
#6638
If values is a
Collection
, a presized builder is used in Maps#uniqueIndex (the change was introduced in this commit)However, for
FilteredCollection
, callingsize()
results in applying thepredicate
to all the elements of theunfiltered
collection (link)To prevent applying the predicate an additional time , presized builder should not be used if
values
is aFilteredCollection
orFilteredMultimapValues
The text was updated successfully, but these errors were encountered: