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

Use built-in StringComparer.OrdinalIgnoreCase StringComparer #8166

Conversation

ThomasGoulet73
Copy link
Contributor

@ThomasGoulet73 ThomasGoulet73 commented Aug 31, 2023

Description

Use built-in StringComparer.OrdinalIgnoreCase StringComparer instead of using a custom IEqualityComparer that does the same thing.

Customer Impact

None.

Regression

No.

Testing

Local build + CI.

Risk

Low.

Microsoft Reviewers: Open in CodeFlow

@ThomasGoulet73 ThomasGoulet73 requested a review from a team as a code owner August 31, 2023 03:59
@ghost ghost assigned ThomasGoulet73 Aug 31, 2023
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Aug 31, 2023
@ghost ghost requested review from dipeshmsft and singhashish-wpf August 31, 2023 03:59
@ghost ghost added the Community Contribution A label for all community Contributions label Aug 31, 2023
@ThomasGoulet73 ThomasGoulet73 force-pushed the use-built-in-ordinalignorecase-stringcomparer branch from 5451f5b to 85b1d91 Compare August 31, 2023 04:03
if (((IEqualityComparer) CU.StringCaseInsensitiveComparer).Equals(
authenticationTypeString,
Enum.GetName(typeof(AuthenticationType), AuthenticationType.Windows)))
if (string.Equals(authenticationTypeString, nameof(AuthenticationType.Windows), StringComparison.OrdinalIgnoreCase))
Copy link
Contributor Author

@miloush
Copy link
Contributor

miloush commented Sep 12, 2023

LGTM

@ThomasGoulet73 ThomasGoulet73 force-pushed the use-built-in-ordinalignorecase-stringcomparer branch from 85b1d91 to 4826b3e Compare September 30, 2023 02:22
@ThomasGoulet73
Copy link
Contributor Author

I rebased to fix the conflicts.

@rchauhan18 rchauhan18 merged commit 6b86b86 into dotnet:main Oct 5, 2023
9 checks passed
@rchauhan18
Copy link
Contributor

Thanks @ThomasGoulet73 for your contribution.

@ThomasGoulet73 ThomasGoulet73 deleted the use-built-in-ordinalignorecase-stringcomparer branch October 30, 2023 16:57
@ghost ghost locked as resolved and limited conversation to collaborators Nov 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Community Contribution A label for all community Contributions Included in test pass PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants