Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/wpfPublic

Refactor WeakReferenceList/CopyOnWriteList as type-safe generic collections#10889

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
h3xds1nz wants to merge24 commits intodotnet:main
base:main
Choose a base branch
Loading
fromh3xds1nz:copy-on-write

Conversation

@h3xds1nz
Copy link
Member

@h3xds1nzh3xds1nz commentedMay 28, 2025
edited by dotnet-policy-servicebot
Loading

Description

Refactors bothCopyOnWriteList andWeakReferenceList as generic type-safe collections.

  • Theoretically, they could have been merged into one but I chose not to currently.

Both lists now support initialization with capacity argument, previously integers passed in (e.g. inPropagateParentOwners) would end up being boxed and the instance of the box being used as a lock. This clearly feels like a mistake.

InResourceDictionaryDiagnostics I've removed few static fields caching empty (readonly) arrays I didn' see in#10267.

Regarding the removed null-checks:

  • Those are a part of theas casting pattern.
  • The enumerator returns strong, non-null references, hence it will never benull in the first place.
  • I've appropriately null-annotated the adjusted files.

SinceContainsOwner is only called from within the three classes, we can remove the type checks and speed it up.

  • Similarly it can be done for Add/Remove but I'll do that after this is in.

Customer Impact

Improved performance a tiny bit, strongly-typed code and newer practices.

Regression

No.

Testing

Local build, unit tests, testing with sample apps including themes and templates.

Risk

Low to medium, I believe the changes are straightforward and understandable but happy to answer any questions (rather sooner than later).

Microsoft Reviewers:Open in CodeFlow

rampaa, lindexi, and jizc reacted with thumbs up emoji
@h3xds1nzh3xds1nz requested a review froma team as acode ownerMay 28, 2025 10:29
@dotnet-policy-servicedotnet-policy-servicebot added the PRmetadata: Label to tag PRs, to facilitate with triage labelMay 28, 2025
@dotnet-policy-servicedotnet-policy-servicebot added the Community ContributionA label for all community Contributions labelMay 28, 2025
@codecov
Copy link

codecovbot commentedMay 28, 2025

Codecov Report

Attention: Patch coverage is0% with249 lines in your changes missing coverage. Please review.

Project coverage is 2.98844%. Comparing base(57fe8ac) to head(3b36966).
Report is 12 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@##                main     #10889          +/-   ##===================================================- Coverage   13.48885%   2.98844%   -10.50041%===================================================  Files           3317       3319           +2       Lines         664749     664828          +79       Branches       74643      74664          +21     ===================================================- Hits           89667      19868       -69799- Misses        572488     644779       +72291+ Partials        2594        181        -2413
FlagCoverage Δ
Debug2.98844% <0.00000%> (-10.50041%)⬇️

Flags with carried forward coverage won't be shown.Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@Arkane5Arkane5 left a comment

Choose a reason for hiding this comment

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

Just a tiny fix for coherence.

jizc reacted with thumbs up emoji
/// <summary>
/// Insert an object into the List at the given index.
/// Without any error checks.
/// For use by derived classes that implement there own error checks.

Choose a reason for hiding this comment

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

Same fix as above

Suggested change
/// For use by derived classes that implementthere own error checks.
/// For use by derived classes that implementtheir own error checks.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dipeshmsftdipeshmsftAwaiting requested review from dipeshmsft

@singhashish-wpfsinghashish-wpfAwaiting requested review from singhashish-wpf

@Kuldeep-MSKuldeep-MSAwaiting requested review from Kuldeep-MS

2 more reviewers

@lindexilindexilindexi left review comments

@Arkane5Arkane5Arkane5 left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

@h3xds1nzh3xds1nz

Labels

Community ContributionA label for all community ContributionsPRmetadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@h3xds1nz@lindexi@Arkane5

[8]ページ先頭

©2009-2025 Movatter.jp