-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Underlying CoreCLR support for new string slicing overloads #15811
Conversation
https://github.com/dotnet/corefx/issues/25254 These add the underlying support for the fast versions of these extension methods.
This PR is part of https://github.com/dotnet/corefx/issues/24072, not 25254. |
|
||
/// <summary>Creates a new <see cref="ReadOnlyMemory{T}"/> over the portion of the target string.</summary> | ||
/// <param name="text">The target string.</param> | ||
/// <exception cref="System.ArgumentNullException">Thrown when <paramref name="text"/> is a null reference (Nothing in Visual Basic).</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.
Is it necessary to specify "Nothing in Visual Basic". If so, should we add that to other comments as well (for example: https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/System/MemoryExtensions.Portable.cs#L63). Is there a way to indicate that Nothing
is a keyword?
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.
The phrase appears in various XML docs (probably all copy-pasted from one instance as these were.) I don't really have a dog in this either way - I'd rather that this PR not be used as the place to debate that issue, though.
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.
Fair enough.
/// <param name="text">The target string.</param> | ||
/// <exception cref="System.ArgumentNullException">Thrown when <paramref name="text"/> is a null reference (Nothing in Visual Basic).</exception> | ||
/// <exception cref="System.ArgumentOutOfRangeException"> | ||
/// Thrown when the specified <paramref name="start"/> index is not in range (<0 or >=text.Length). |
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.
Comment vs code mismatch. index is not in range (<0 or >=text.Length)
The code throws if start > text.Length
Here and elsewhere.
return new ReadOnlyMemory<char>(text, start, text.Length - start); | ||
} | ||
|
||
/// <summary>Creates a new <see cref="ReadOnlyMemory{T}"/> over the portion of the target string.</summary> |
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.
We create a ReadOnlyMemory<char>
not ReadOnlyMemory{T}
.
Here and elsewhere.
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.
Otherwise, LGTM.
https://github.com/dotnet/corefx/issues/24072 These add the underlying support for the fast versions of these extension methods.
https://github.com/dotnet/corefx/issues/25254
These add the underlying support for the fast versions of
these extension methods.