Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix TODO to cleanup Tests by removing AsReadOnySpan/Memory and update callsites#28962

Merged
ahsonkhan merged 1 commit intodotnet:masterfrom
ahsonkhan:FixTodos
Apr 10, 2018
Merged

Fix TODO to cleanup Tests by removing AsReadOnySpan/Memory and update callsites#28962
ahsonkhan merged 1 commit intodotnet:masterfrom
ahsonkhan:FixTodos

Conversation

@ahsonkhan
Copy link

@ahsonkhan ahsonkhan commented Apr 10, 2018

@ahsonkhan ahsonkhan self-assigned this Apr 10, 2018
@ahsonkhan ahsonkhan requested a review from a user April 10, 2018 03:23
@ahsonkhan
Copy link
Author

}
var span = new Span<char>(a);
bool result = span.AsReadOnlySpan().IsWhiteSpace();
bool result = ((ReadOnlySpan<char>)span).IsWhiteSpace();
Copy link
Member

Choose a reason for hiding this comment

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

I assume we have IsWhitespace that extends Span directly so people don't have to do this cast. i.e. the cast is for testing purposes only.

Copy link
Author

Choose a reason for hiding this comment

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

IsWhiteSpace extends ReadOnlySpan<char> only and is not visible on Span<char>. So, if someone has Span<char>, they would need the explicit cast or call the ReadOnlySpan ctor (or rely on a local ReadOnlySpan from the span, using implicit cast).

@ahsonkhan ahsonkhan merged commit b1be362 into dotnet:master Apr 10, 2018
@ahsonkhan ahsonkhan deleted the FixTodos branch April 10, 2018 19:55
@karelz karelz added this to the 2.1.0 milestone Apr 12, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
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