Skip to content

Use string.ToUpperOrdinal in SearchValues<string> construction - #130549

Merged
MihaZupan merged 1 commit into
dotnet:mainfrom
MihaZupan:searchvalues-usestringordinal
Jul 13, 2026
Merged

MihaZupan merged 1 commit into
dotnet:mainfrom
MihaZupan:searchvalues-usestringordinal

Conversation

@MihaZupan

Copy link
Copy Markdown
Member

Simplify one place by calling a new API

@MihaZupan MihaZupan added this to the 11.0.0 milestone Jul 11, 2026
@MihaZupan MihaZupan self-assigned this Jul 11, 2026
Copilot AI review requested due to automatic review settings July 11, 2026 14:49
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates SearchValues<string> construction to normalize case-insensitive input strings by calling string.ToUpperOrdinal() instead of maintaining a local ASCII character set and manually invoking Globalization.Ordinal.ToUpperOrdinal.

Changes:

  • Remove the local s_allAsciiExceptLowercase SearchValues<char> and the associated manual uppercasing implementation.
  • Replace NormalizeIfNeeded with a call to value.ToUpperOrdinal() when ignoreCase is true.
  • Drop the now-unused using System.Globalization;.

@adamsitnik adamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@MihaZupan
MihaZupan merged commit 0ded4d2 into dotnet:main Jul 13, 2026
152 of 155 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot modified the milestones: 11.0.0, 11.0-preview7 Jul 14, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants