Skip to content

Conversation

@MarkCBB
Copy link
Contributor

@MarkCBB MarkCBB commented Apr 2, 2019

When iterating a collection in a reverse order the 0 index should be included.

Summary

This bit of code does not include the element at the position 0
for(int i=myCount-1;i>0;i--)
The proposed change is
for(int i=myCount-1;i>-1;i--)

When iterating a collection in a reverse order the 0 index should be included.
@MarkCBB MarkCBB requested a review from rpetrusha as a code owner April 2, 2019 07:10
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this fix @MarkCBB

I've reviewed this and I'll :shipit: now.

Thanks for helping us improve.

@BillWagner BillWagner merged commit 9e4ee18 into dotnet:master Apr 2, 2019
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