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 more specific ConcurrentMap methods #2188

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

bondolo
Copy link
Contributor

@bondolo bondolo commented Apr 13, 2022

Motivation:
The current use of ConcurrentMap methods, especially for remove()
could be more specific about what it expects to remove or replace and
the operation should fail if the expectation is not met.
Modifications:
Use ConcurrentMap::remove(key, value) and
ConcurrentMap::replace(key, oldValue, newValue) methods
Result:
Greater assurance of correct behavior as the removed and replaced
values are checked.

Motivation:
The current use of `ConcurrentMap` methods, especially for `remove()`
could be more specific about what it expects to remove or replace and
the operation should fail if the expectation is not met.
Modifications:
Use `ConcurrentMap::remove(key, value)` and
`ConcurrentMap::replace(key, oldValue, newValue)` methods
Result:
Greater assurance of correct behavior as the removed and replaced
values are checked.
@bondolo bondolo self-assigned this Apr 13, 2022
@bondolo bondolo added the enhancement New feature or request label Apr 13, 2022
@bondolo bondolo merged commit 78d1186 into apple:main Apr 13, 2022
@bondolo bondolo deleted the DefaultClientGroup-nits branch April 13, 2022 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants