Use Contains{Any} in Regex source generator by MihaZupan · Pull Request #112065 · dotnet/runtime · GitHub
Skip to content

Use Contains{Any} in Regex source generator#112065

Merged
danmoseley merged 1 commit into
dotnet:mainfrom
MihaZupan:regex-contains
Feb 2, 2025
Merged

Use Contains{Any} in Regex source generator#112065
danmoseley merged 1 commit into
dotnet:mainfrom
MihaZupan:regex-contains

Conversation

@MihaZupan

@MihaZupan MihaZupan commented Feb 1, 2025

Copy link
Copy Markdown
Member

The compiler would be more annoying to match here since it can't be a simple string replace.

Replaces

if (slice.Slice(0, 40).IndexOfAnyExcept(Utilities.s_asciiHexDigitsLower) >= 0)

with

if (slice.Slice(0, 40).ContainsAnyExcept(Utilities.s_asciiHexDigitsLower))

In the one place where we aren't making further use of the actual index.

@MihaZupan MihaZupan added this to the 10.0.0 milestone Feb 1, 2025
@MihaZupan MihaZupan self-assigned this Feb 1, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

@MihaZupan

Copy link
Copy Markdown
Member Author

@MihuBot regexdiff

@MihuBot

MihuBot commented Feb 1, 2025

Copy link
Copy Markdown

@stephentoub stephentoub 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.

Thanks

@danmoseley danmoseley merged commit 5a8f405 into dotnet:main Feb 2, 2025
grendello added a commit to grendello/runtime that referenced this pull request Feb 3, 2025
* main:
  System.Net.Http.WinHttpHandler.StartRequestAsync assertion failed (dotnet#109799)
  Keep test PDB in helix payload for native AOT (dotnet#111949)
  Build the RID-specific System.IO.Ports packages in the VMR (dotnet#112054)
  Always inline number conversions (dotnet#112061)
  Use Contains{Any} in Regex source generator (dotnet#112065)
  Update dependencies from https://github.com/dotnet/arcade build 20250130.5 (dotnet#112013)
  JIT: Transform single-reg args to FIELD_LIST in physical promotion (dotnet#111590)
  Ensure that math calls into the CRT are tracked as needing vzeroupper (dotnet#112011)
  Use double.ConvertToIntegerNative where safe to do in System.Random (dotnet#112046)
  JIT: Compute `fgCalledCount` after synthesis (dotnet#112041)
  Simplify boolean logic in `TimeZoneInfo` (dotnet#112062)
  JIT: Update type when return temp is freshly created (dotnet#111948)
  Remove unused build controls and simplify DotNetBuild.props (dotnet#111986)
  Fix case-insensitive JSON deserialization of enum member names (dotnet#112028)
  WasmAppBuilder: Remove double computation of a value (dotnet#112047)
  Disable LTCG for brotli and zlibng. (dotnet#111805)
  JIT: Improve x86 unsigned to floating cast codegen (dotnet#111595)
  simplify x86 special intrinsic imports (dotnet#111836)
  JIT: Try to retain entry weight during profile synthesis (dotnet#111971)
  Fix explicit offset of ByRefLike fields. (dotnet#111584)
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 5, 2025
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.

4 participants