Skip to content

Commit

Permalink
Reduce ImmutableSetMultimap.Builder memory usage by using `CompactH…
Browse files Browse the repository at this point in the history
…ashSet`.

We were already doing this for Android, but it looks potentially valuable on the JVM, too.

RELNOTES=n/a
PiperOrigin-RevId: 591339357
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Dec 15, 2023
1 parent 0d6dc00 commit 4789972
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guava/src/com/google/common/collect/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Map<K, V> preservesInsertionOrderOnPutsMap() {
* for insertions.
*/
static <E extends @Nullable Object> Set<E> preservesInsertionOrderOnAddsSet() {
return Sets.newLinkedHashSet();
return CompactHashSet.create();
}

/**
Expand Down

0 comments on commit 4789972

Please sign in to comment.