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

Conversation

@Anipik
Copy link

@Anipik Anipik commented May 16, 2019

Fixes https://github.com/dotnet/corefx/issues/35063

We only throw exceptions when the end index of sliced\AsSpan\Ctor query is greater than length. when the index = length, we just return an empty span

@Anipik Anipik requested a review from ahsonkhan May 16, 2019 18:10
@ahsonkhan ahsonkhan added documentation Documentation bug or enhancement, does not impact product or test code area-System.Memory labels May 17, 2019
@ahsonkhan
Copy link

LGTM. However, we should make this change in the api-docs repo itself for each instance this is incorrect. For example:
https://docs.microsoft.com/en-us/dotnet/api/system.span-1.slice?view=netcore-3.0#System_Span_1_Slice_System_Int32_

index is less than zero or greater than or equal to Length.

  1. It should be start, not index
  2. It should be greater than Length, (not greater than or equal)

See issue dotnet/dotnet-api-docs#1771

cc @mairaw

@jkotas jkotas merged commit 782585e into dotnet:master May 17, 2019
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/corert that referenced this pull request May 17, 2019
)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
jkotas pushed a commit to dotnet/corert that referenced this pull request May 17, 2019
)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/corefx that referenced this pull request May 17, 2019
)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
tarekgh pushed a commit to dotnet/corefx that referenced this pull request May 17, 2019
)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/mono that referenced this pull request May 21, 2019
)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
marek-safar pushed a commit to mono/mono that referenced this pull request May 21, 2019
)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
franksinankaya pushed a commit to franksinankaya/coreclr that referenced this pull request May 30, 2019
@Anipik Anipik deleted the Docs branch August 8, 2019 19:25
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.

Labels

area-System.Memory documentation Documentation bug or enhancement, does not impact product or test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Span<T>'s Slice method do not throw if Length property is supplied as start parameter

3 participants