New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add List<T>.CopyTo Span<T> APIs #891
Conversation
Add List<T>.CopyTo(Span<T> destination) and List<T>.CopyTo(int sourceIndex, int count, Span<T> destination) Fix https://github.com/dotnet/corefx/issues/33006
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs
Show resolved
Hide resolved
Fix CopyTo(Span<T>) overload to pass the right size Add test to ensure Copy Span doesn't copy more than List.Count when the backing array is larger than List
@jkotas is it my PR, or CI is broken? |
CI is broken. |
Commenter does not have sufficient privileges for PR 891 in repo dotnet/runtime |
1 similar comment
Commenter does not have sufficient privileges for PR 891 in repo dotnet/runtime |
/azp run runtime-coreclr |
/azp run runtime-libraries |
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs
Show resolved
Hide resolved
The new public APIs have been properly documented with triple slash comments. Thanks @felipepessoto. Removing the label. |
I spoke with @eerhardt and @jkotas and I think we agreed that it makes sense to not add this APIs given we can achieve the same using CollectionsMarshal and also that in order to have a "complete" span support and also, adding these APIs might slow down other operations on Sorry @felipepessoto for this and thanks for the effort on putting this together, looking forward to your next contribution 😄 -- will close this, if people disagree, we can of course re-open. |
Add List.CopyTo(Span destination) and List.CopyTo(int sourceIndex, int count, Span destination)
Fix https://github.com/dotnet/corefx/issues/33006
I watched the Design Review video but I still have some questions (this is my first non-trivial contribution).
Thanks
@safern @sywhang