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

Fix CA1805 for unnecessary initialization of fields #38410

Merged
merged 1 commit into from
Jun 26, 2020

Commits on Jun 26, 2020

  1. Fix CA1805 for unnecessary initialization of fields

    This has three primary benefits:
    1. In some cases, in particular for static fields where other static fields have non-default initialization, the C# compiler can't elide the default initialization, resulting in more IL.
    2. It highlights places where the field is otherwise unused and can be deleted, but where the presence of the initialization was silencing the C# compiler's warnings about the unused field.
    3. It increases consistency and decreases maintenance / code size / etc.
    stephentoub committed Jun 26, 2020
    Configuration menu
    Copy the full SHA
    a61b380 View commit details
    Browse the repository at this point in the history