KEMBAR78
Add MemoryExtensions.Count by bollhals · Pull Request #80662 · dotnet/runtime · GitHub
Skip to content

Conversation

@bollhals
Copy link
Contributor

Closes #59466

Original implementation from @stephentoub.

Testcases added for single values and the same tests for ReadOnlySpans.
Types tested are byte, int, TInt and string.

Test cases are mostly copied / inspired by other similar methods like Contains.

@ghost
Copy link

ghost commented Jan 15, 2023

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jan 15, 2023
@dnfadmin
Copy link

dnfadmin commented Jan 15, 2023

CLA assistant check
All CLA requirements met.

@ghost
Copy link

ghost commented Jan 15, 2023

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

Issue Details

Closes #59466

Original implementation from @stephentoub.

Testcases added for single values and the same tests for ReadOnlySpans.
Types tested are byte, int, TInt and string.

Test cases are mostly copied / inspired by other similar methods like Contains.

Author: bollhals
Assignees: -
Labels:

area-System.Memory, new-api-needs-documentation

Milestone: -

@stephentoub
Copy link
Member

Thanks for working on this!

@danmoseley
Copy link
Member

Perhaps it was already mentioned above, but do you plan to follow up with a PR to add test cases to dotnet/performance?

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks!

@stephentoub stephentoub force-pushed the memoryextensionscount branch from 131e102 to cc124a0 Compare January 27, 2023 16:37
@stephentoub stephentoub merged commit ddabb6e into dotnet:main Jan 27, 2023
@bollhals bollhals deleted the memoryextensionscount branch January 27, 2023 21:12
@ghost ghost locked as resolved and limited conversation to collaborators Feb 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Memory community-contribution Indicates that the PR has been added by a community member new-api-needs-documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: MemoryExtensions.Count / number of occurrences of a value in a span

7 participants