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

Fix FindLastIndex function to iterate over the entire slice #48

Merged

Conversation

dan1elhughes
Copy link
Contributor

FindLastIndex wasn't finding the index if the matching element was in position zero due to an i > 0 iteration condition that should be i >= 0.

Added a test case that fails without this fix.

@Goldziher Goldziher merged commit 6720fe2 into Goldziher:main May 19, 2024
6 checks passed
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