Skip to content
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 bulk add/remove/read methods using spans. #8

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

mpartel
Copy link

@mpartel mpartel commented Dec 15, 2022

  • Added factory methods because overloaded constructors taking (ReadOnlySpan<T> span) and (IEnumerable<T> collection) would be ambiguous given an array.
  • This bumps the minimum .NET requirement to .NET Standard 2.1.

This bumps the minimum .NET requirement to .NET Standard 2.1.
I'm hesitant to add CopyFromBackToSpan because it's not clear
if it would be intuitive for it to copy to the end or the
beginning of the destination span.
@StephenCleary
Copy link
Owner

I love the span APIs but I can't take the netstandard bump. Can you change this PR to multitarget instead?

@mpartel
Copy link
Author

mpartel commented Dec 15, 2022

Done, I think (somewhat new to C# outside of Unity)

@mpartel
Copy link
Author

mpartel commented Jan 18, 2023

Ping. Sorry for piling on more changes afterwards. Should be all done now.

@mpartel
Copy link
Author

mpartel commented Jan 23, 2023

^ or so I thought 🤦‍♂️

@StephenCleary StephenCleary self-assigned this Mar 8, 2023
@StephenCleary
Copy link
Owner

Note to self: compare this API with dotnet/runtime#1530

@StephenCleary
Copy link
Owner

.NET 8.0 just got span overloads for List<T>: InsertRange, AddRange, CopyTo.

https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-8/

@StephenCleary
Copy link
Owner

Also should include CollectionBuilder in .NET 8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants