Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Alex-Sob
Copy link

Description

Currently DisposeObjectsBeforeLosingScope analyzer always allocates a ConcurrentDictionary<K, V> when it's initialized. As it's used to avoid reporting duplicate diagnostics for the same location, it's only needed when there are rule violations in code.

Suggested improvement

Defer dictionary allocation until it's actually needed in the case when rule violations are detected. This should avoid the allocation for successful builds.

Testing

All unit tests for this analyzer passed.

This PR has already been reviewed by @stephentoub (the original was created in the wrong repo)

@Alex-Sob Alex-Sob requested a review from a team as a code owner August 17, 2025 09:49
@Alex-Sob
Copy link
Author

Alex-Sob commented Aug 22, 2025

Hello @stephentoub! This is a PR that has been reviewed by you the other day (I re-created PR submitted by mistake to the old repo). Also I would like to contribute the following PRs with analyzer fixes and performance improvements:

#50397
#50339
#50411
#50310
#50367

Is it possible to get these PRs reviewed? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants