Skip to content

Add common suffix length for spans - #136179

Open
RutulPatel8 wants to merge 2 commits into
dotnet:mainfrom
RutulPatel8:feature/common-suffix-length-127630
Open

RutulPatel8 wants to merge 2 commits into
dotnet:mainfrom
RutulPatel8:feature/common-suffix-length-127630

Conversation

@RutulPatel8

Copy link
Copy Markdown
Contributor

Implements the two ReadOnlySpan<T>.CommonSuffixLength overloads approved in #127630.

CommonPrefixLength counts matching elements from the start of two spans. This API counts matching elements from the end, including when the spans have different lengths. It supports default equality or a supplied IEqualityComparer<T>.

The change adds the implementation, public reference signatures, and tests for empty and unequal spans, custom comparers, reference types, and floating-point equality.

Validation:

  • Managed CoreLib, System.Memory reference assembly, shared libraries, and System.Memory test project built with no warnings or errors.
  • The targeted tests could not run locally because the native test host lacks dotnet.exe; this machine needs the Visual Studio C++ tools to build that host.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 20, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

@RutulPatel8

Copy link
Copy Markdown
Contributor Author

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 136179 in repo dotnet/runtime

@RutulPatel8

RutulPatel8 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

@dotnet/area-system-memory Could an area maintainer review this contribution once the refreshed CI run completes? The previous run failed in tests outside System.Memory. The Azure bot rejected my manual rerun command because fork authors lack permission, so I pushed an empty commit (165bf6ccc795) to trigger fresh CI without changing the implementation. I also noticed the overlapping #133453; guidance on which PR you would prefer to take would be appreciated. Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Memory 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.

1 participant