Skip to content

Simplify KeyAnalyzer - #88709

Merged
stephentoub merged 1 commit into
dotnet:mainfrom
IDisposable:neaten
Jul 17, 2023
Merged

Simplify KeyAnalyzer#88709
stephentoub merged 1 commit into
dotnet:mainfrom
IDisposable:neaten

Conversation

@IDisposable

Copy link
Copy Markdown
Contributor

Just a trivial code-review item. The assignment bool canSwitchIgnoreCaseToCaseSensitive = ignoreCase; can just be bool canSwitchIgnoreCaseToCaseSensitive = true; since we're just tested that value a couple lines up with if (ignoreCase). This DOES emit different code at the IL level.

The assignment `bool canSwitchIgnoreCaseToCaseSensitive = ignoreCase;` can just be `bool canSwitchIgnoreCaseToCaseSensitive = true;` since we're just tested that value a couple lines up
@ghostghost added community-contribution Indicates that the PR has been added by a community member area-System.Collections labels Jul 11, 2023
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-collections
See info in area-owners.md if you want to be subscribed.

Issue Details

Just a trivial code-review item. The assignment bool canSwitchIgnoreCaseToCaseSensitive = ignoreCase; can just be bool canSwitchIgnoreCaseToCaseSensitive = true; since we're just tested that value a couple lines up with if (ignoreCase). This DOES emit different code at the IL level.

Author:IDisposable
Assignees:-
Labels:

area-System.Collections, community-contribution

Milestone:-

// was requested, as there's nothing that would compare equally to the substring
// other than the substring itself.
bool canSwitchIgnoreCaseToCaseSensitive = ignoreCase;
bool canSwitchIgnoreCaseToCaseSensitive = true;

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@stephentoub
stephentoub merged commit 56552c2 into dotnet:mainJul 17, 2023
@IDisposable
IDisposable deleted the neaten branch July 20, 2023 23:59
@ghostghost locked as resolved and limited conversation to collaborators Aug 20, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Collectionscommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@IDisposable@stephentoub@eiriktsarpalis