Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a pointer receiver for internal/set.Set #1951

Merged
merged 1 commit into from
May 11, 2023

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented May 10, 2023

... to make sure that, and clear to callers that, Add() and Delete() modify the original object and not a copy.

Luckily(?), this has worked fine, because Set contains a map[], which is a reference type, so a copy of Set just creates another reference to the same map.

Either way, fix the method receivers, and add tests to ensure the code works as expected.

... to make sure that, and clear to callers that, Add() and Delete()
modify the original object and not a copy.

Luckily(?), this has worked fine, because Set contains a map[],
which is a reference type, so a copy of Set just creates another
reference to the same map.

Either way, fix the method receivers, and add tests to ensure
the code works as expected.

Signed-off-by: Miloslav Trmač <[email protected]>
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vrothberg vrothberg merged commit f5a3b20 into containers:main May 11, 2023
@mtrmac mtrmac deleted the set-pointer branch May 11, 2023 17:58
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.

2 participants