Skip to content

Add ConditionalWeakTable.Remove(key, out value) polyfill - #576

Merged
SimonCropp merged 1 commit into
mainfrom
conditional-weak-table-remove
Aug 12, 2026
Merged

Add ConditionalWeakTable.Remove(key, out value) polyfill#576
SimonCropp merged 1 commit into
mainfrom
conditional-weak-table-remove

Conversation

@SimonCropp

Copy link
Copy Markdown
Owner

Fixes #574

The two-argument Remove overload only became public in .NET 10, so the polyfill applies to all targets below that.

Implemented as TryGetValue followed by Remove. Noted in the api list that this is not atomic with regard to concurrent mutations, since the lookup and removal do not share the table lock.

Fixes #574

The two-argument Remove overload only became public in .NET 10, so the
polyfill applies to all targets below that.

Implemented as TryGetValue followed by Remove. Noted in the api list that
this is not atomic with regard to concurrent mutations, since the lookup
and removal do not share the table lock.
@SimonCropp SimonCropp added this to the 11.1.0 milestone Aug 12, 2026
@SimonCropp
SimonCropp merged commit 0e4ea44 into main Aug 12, 2026
4 of 6 checks passed
@SimonCropp
SimonCropp deleted the conditional-weak-table-remove branch August 12, 2026 11:44
This was referenced Aug 12, 2026
This was referenced Aug 12, 2026
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.

Add ConditionalWeakTable.Remove(key, out value) polyfill

1 participant