Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change RealMultibinder#doProvision to use ImmutableSet#buildWithExpec…
…tedSize, and avoid an extra T[] array allocation when permitDuplicates==true. Since the normal usage should be that the items in the values array are all unique, and ImmutableSet#copyOf will create an initial list of max(4, sqrt(length)) if length>4, but then grows that list to length (or larger) if the array was all unique (and then resize is back down during build()). While here, the T[] values array is also only needed to be filled in when permitDuplicates==false (for the error message if duplicates were detected). PiperOrigin-RevId: 597244931
- Loading branch information