Skip to content

Use more performant span APIs#67150

Open
martincostello wants to merge 3 commits into
dotnet:mainfrom
martincostello:gh-19771
Open

Use more performant span APIs#67150
martincostello wants to merge 3 commits into
dotnet:mainfrom
martincostello:gh-19771

Conversation

@martincostello

@martincostello martincostello commented Jun 11, 2026

Copy link
Copy Markdown
Member

Use more performant span APIs

Use some new span-based APIs in some remaining call sites.

Description

Changes:

  • Use SearchValues to search for invalid path characters in EmbeddedFileProvider and EmbeddedFilesManifest.
  • Use span-based methods in BindingAddress and UrlPrefix.

New analysers since 2022 have flushed out most of the possible improvements that existed at the time the issue was created, so these changes should allow the original issue to be closed off.

Fixes #39771

- Use `SearchValues` to search for invalid path characters in `EmbeddedFileProvider` and `EmbeddedFilesManifest`.
- Use span-based methods in `BindingAddress` and `UrlPrefix`.

Fixes dotnet#39771.
@github-actions github-actions Bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jun 11, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 11, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @martincostello. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Comment thread src/FileProviders/Embedded/src/Manifest/EmbeddedFilesManifest.cs
Comment thread src/Servers/HttpSys/src/UrlPrefix.cs Outdated
Comment thread src/Http/Http/src/BindingAddress.cs Outdated
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Comment thread src/FileProviders/Embedded/src/Manifest/EmbeddedFilesManifest.cs Outdated
Comment thread src/FileProviders/Embedded/src/Manifest/EmbeddedFilesManifest.cs Outdated
Comment thread src/FileProviders/Embedded/src/Manifest/EmbeddedFilesManifest.cs Outdated
Comment thread src/FileProviders/Embedded/src/Manifest/EmbeddedFilesManifest.cs Outdated
Comment thread src/FileProviders/Embedded/src/EmbeddedFileProvider.cs Outdated
Comment thread src/FileProviders/Embedded/src/EmbeddedFileProvider.cs Outdated
Comment thread src/FileProviders/Embedded/src/EmbeddedFileProvider.cs Outdated
Comment thread src/FileProviders/Embedded/src/EmbeddedFileProvider.cs Outdated
Comment thread src/FileProviders/Embedded/src/EmbeddedFileProvider.cs Outdated
Revert overlapping changes with dotnet#67018.
@MihaZupan MihaZupan enabled auto-merge (squash) June 11, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions 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.

Use ReadOnlySpan<char> equivalents for string methods?

2 participants