Skip to content

fix slice_before on empty enumerable#822

Merged
BanzaiMan merged 1 commit intojruby:masterfrom
statianzo:slice_before-fix
Jun 24, 2013
Merged

fix slice_before on empty enumerable#822
BanzaiMan merged 1 commit intojruby:masterfrom
statianzo:slice_before-fix

Conversation

@statianzo
Copy link
Contributor

This fixes an issue where calling slice_before on an empty enumerable
would return an enumerable containing one element of nil

#before
[].slice_before(1).to_a #=> [nil]
#after
[].slice_before(1).to_a #=> []

Would you also like a test added to rubyspec around this?

This fixes an issue where calling slice_before on an empty enumerable
would return an enumerable containing one element of nil
BanzaiMan added a commit that referenced this pull request Jun 24, 2013
fix slice_before on empty enumerable
@BanzaiMan BanzaiMan merged commit 69744e1 into jruby:master Jun 24, 2013
@BanzaiMan
Copy link
Member

Thanks! The test should go to RubySpec.

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