-
Notifications
You must be signed in to change notification settings - Fork 286
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
Improved RawList API, Implementation and Tests #830
Conversation
#CHANGE: RawList<T> now provides a by-ref indexer instead of the previous by-value indexer.
#REMOVE: Removed method overloads from RawList<T> that accept IEnumerable<T> to avoid suggesting an efficient implementation.
#CHANGE: Tweaked implementations of RawList<T> Add and Reserve methods to improve performance.
#ADD: Added RawList<T> methods RemoveLast, RemoveAtFast and RemoveRangeFast to allow more efficient removal in specific scenarios.
#CHANGE: Replaced custom RawList<T> FunctorComparer with the default Comparer<T>.Create helper.
For the performance improvements did you do any testing (benchmarkdotnet?)? Pretty sure this improves the performance but its always good to verify and also know how much it improves it. |
Addressed the change request you made, see above.
You're right, but no, I didn't run any benchmarks. Mostly for time reasons and given the very small scope of the two tweaks, I stopped at "pretty sure it's an improvement". |
Ok well as the changes are pretty small and seem to make sense iam assuming it will be ok :) |
As noted in #820, the
RawList<T>
class can benefit from newly available ref-returns in C# 7.3 for its indexer implementation. Since this is a breaking change for v4.0, it also was a good opportunity to rework and extend some of its API to better address its core use case.This PR adds several small improvements, as well as a by-ref indexer for
RawList<T>
. For a detailed list, see the individual commits, which have been structured so each one represents a group of changes.