Skip to content

Comments

Don't unnecessarily copy the input ImmutableSetMultimap.#2026

Closed
copybara-service[bot] wants to merge 0 commit intomainfrom
test_872548716
Closed

Don't unnecessarily copy the input ImmutableSetMultimap.#2026
copybara-service[bot] wants to merge 0 commit intomainfrom
test_872548716

Conversation

@copybara-service
Copy link
Contributor

Don't unnecessarily copy the input ImmutableSetMultimap.

The copy hasn't been necessary since the type change in cl/316968142.

(Calling ImmutableSetMultimap.copyOf on an ImmutableSetMultimap instance is not always a no-op: It can be used to "trim" a partial view, which I think you could get from someImmutableSortedMap.subMap(...).asMultimap() or something. But I don't think that's what's going on here, and even if it were, this CL would probably still be an improvement.)

(Incidentally, the implementation of the private overload of ImmutableSetMultimap.copyOf looks a bit scary. But that's a job for cl/872557235.)

RELNOTES=n/a

@copybara-service copybara-service bot closed this Feb 19, 2026
@copybara-service copybara-service bot deleted the test_872548716 branch February 19, 2026 22:33
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.

0 participants