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

Simplify KeyAnalyzer #88709

Merged
merged 1 commit into from
Jul 17, 2023
Merged

Simplify KeyAnalyzer #88709

merged 1 commit into from
Jul 17, 2023

Conversation

IDisposable
Copy link
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
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jul 11, 2023
@ghost
Copy link

ghost commented Jul 11, 2023

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: -

@@ -124,7 +124,7 @@ private static bool TryUseSubstring(ReadOnlySpan<string> uniqueStrings, bool ign
// actually perform the comparison as case-sensitive even if case-insensitive
// 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
Contributor Author

Choose a reason for hiding this comment

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

See line 121

@stephentoub stephentoub merged commit 56552c2 into dotnet:main Jul 17, 2023
103 checks passed
@IDisposable IDisposable deleted the neaten branch July 20, 2023 23:59
@ghost ghost locked as resolved and limited conversation to collaborators Aug 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Collections community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants