-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix LINQ Last() in ConcatNIterator to also check base case (Concat2Iterator) #108486
Fix LINQ Last() in ConcatNIterator to also check base case (Concat2Iterator) #108486
Conversation
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.
Thank you, @andrewjsaid!
This looks good to me, but I'd like @krwq or @eiriktsarpalis to review as well before merge. Once the fix is merged, we'll backport this to .NET 9 as well.
@andrewjsaid thanks for the contribution! Have you perhaps checked if other APIs in the speed optimizations might have similar issues? (i.e. TryGetFirst or similar) |
@krwq You're welcome. Yes I did check and it looks like |
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.
Thanks
/backport to release/9.0 |
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/11239355958 |
fixes #108477
ConcatNIterator.PreviousN
returnsnull
in the base case as_tail
isConcat2Iterator
. I've copied theConcatNIterator<TSource>? node, previousN = this;
pattern used in other methods over to here and added test cases