guava icon indicating copy to clipboard operation
guava copied to clipboard

DO NOT MERGE

Open copybara-service[bot] opened this issue 9 months ago • 0 comments
trafficstars

DO NOT MERGE

Demo of Guava changes for https://github.com/openjdk/jdk/pull/23461.

This change pre-sizes collectors for which the size of the output collection must match the size of the input stream. It omits cases like ImmutableSet (which deduplicates), but it includes cases ImmutableList (obviously) and ImmutableMap/ImmutableBiMap (which rejects duplicate keys).

RELNOTES=collect: Changed toImmutableList, toImmutableMap, and toImmutableBiMap to internally pre-size their collections when possible.

copybara-service[bot] avatar Feb 12 '25 15:02 copybara-service[bot]