Skip to content

Conversation

copybara-service[bot]
Copy link
Contributor

DO NOT MERGE

Demo of Guava changes for openjdk/jdk#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.

Demo of Guava changes for openjdk/jdk#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.
PiperOrigin-RevId: 725756865
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant