Skip to content

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

Merged
enebo merged 1 commit intojruby:masterfrom
mejackreed:fix-slice_when
Sep 19, 2018
Merged

Fixes underlying logic of slice_when / chunk_while to handle 1 element collections#5276
enebo merged 1 commit intojruby:masterfrom
mejackreed:fix-slice_when

Conversation

@mejackreed
Copy link
Contributor

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.

Enumerables with 1 element

Fixes jruby#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
@enebo
Copy link
Member

enebo commented Sep 19, 2018

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

@mejackreed
Copy link
Contributor Author

No problem. Thanks for accepting the PR!

@mejackreed mejackreed deleted the fix-slice_when branch September 19, 2018 21:13
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