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

Fixes underlying logic of slice_when / chunk_while to handle 1 element collections #5276

Merged
merged 1 commit into from Sep 19, 2018

Conversation

Projects
None yet
2 participants
@mejackreed
Copy link
Contributor

commented Aug 7, 2018

Enumerables with 1 element

Fixes #5275. Instead of checking for size 1 at the beginning, this change sets a
flag that never gets modified if each_cons(2) does not get called.
This happens in the case of 1 element Enumerables. The previous
behavior was fine for Enumerables that respond to size but fails
otherwise.

Modifies underlying logic of slice_when / chunk_while to handle
Enumerables with 1 element

Fixes #5275. Instead of checking for size 1 at the beginning, this change sets a
flag that never gets modified if `each_cons(2)` does not get called.
This happens in the case of 1 element Enumerables. The previous
behavior was fine for Enumerables that respond to `size` but fails
otherwise.

@mejackreed mejackreed changed the title Modifies underlying logic of slice_when / chunk_while to handle Fixes underlying logic of slice_when / chunk_while to handle 1 element collections Aug 7, 2018

@enebo enebo added this to the JRuby 9.2.1.0 milestone Sep 19, 2018

@enebo enebo merged commit 5e57d43 into jruby:master Sep 19, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@enebo

This comment has been minimized.

Copy link
Member

commented Sep 19, 2018

@mejackreed sorry we did not merge this a lot sooner.

@mejackreed

This comment has been minimized.

Copy link
Contributor Author

commented Sep 19, 2018

No problem. Thanks for accepting the PR!

@mejackreed mejackreed deleted the mejackreed:fix-slice_when branch Sep 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.