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

Remove cursor decrement from advance_cursor_while #73

Merged

Conversation

Grimeh
Copy link
Contributor

@Grimeh Grimeh commented Apr 9, 2023

This addresses the issues raised in #72.

The call to decrement_cursor has been removed and the method documentation has been expanded upon to communicate the behaviour a bit more explicitly.

Grimeh added 2 commits April 9, 2023 15:05
Previously the cursor would end up pointing to the last element that passed, rather than the first element that fails.
This updates the existing `check_move_forward_while` test cases, and adds a new `check_move_forward_while_fast_fail` test case for testing that a cursor isn't decremented if the first element fails the predicate.
@Grimeh
Copy link
Contributor Author

Grimeh commented Apr 10, 2023

Whoops, forgot to update test cases. I've done so and added one for testing that the cursor isn't decremented in the edge case where the first element fails the predicate.

@foresterre
Copy link
Owner

Thanks a lot for both the clear issue and providing a fix!

@foresterre
Copy link
Owner

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 11, 2023

@bors bors bot merged commit 69e4cdb into foresterre:main Apr 11, 2023
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