-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Mirror changes from dotnet/corefx #16520
Conversation
* Rename string-slicing extension methods As part of https://github.com/dotnet/corefx/issues/26894 the api folks have approved renaming AsROSpan and AsROMemory on string instances to AsSpan and AsMemory (as the "readonly" is obvious given the read-only nature of the input.) This puts the renaming in effect. Basically a big search-replace commit. * Fix OpenSSL build break * I see this is going to be a treadmill Signed-off-by: dotnet-bot-corefx-mirror <[email protected]>
|
cc @atsushikan |
| } | ||
|
|
||
| public ReadOnlySpan<T> AsReadOnlySpan() | ||
| public ReadOnlySpan<T> AsSpan() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so - we are using AsSpan everywhere, this one should not be an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree and it makes sense. I was just wondering if we need to update any calls to this method as well.
Would it be easier to resolve this separately from the mirror?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are changing the public surface of share file, it has to be done via the mirror. I do not know how else we would do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Will we then append the change to the calls in the mirror PR on the corefx side (along with the coreclr version update PR)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right
| } | ||
|
|
||
| // TODO: Delete once the AsReadOnlySpan -> AsSpan rename propages through the system | ||
| public static ReadOnlySpan<char> AsReadOnlySpan(this string text) => AsSpan(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to temporarily add the AsReadOnlyMemory APIs too and update AsReadOnlyMemory -> AsMemory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - as part of your other change, but it is not needed to get this PR go through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. No one in this repo calls AsReadOnlyMemory.
This PR contains mirrored changes from dotnet/corefx
Please REBASE this PR when merging