Don't dup every element in Enumerator#drop (9K) #4225

Merged
merged 1 commit into from Nov 8, 2016

Projects

None yet

3 participants

@iconara
Contributor
iconara commented Oct 13, 2016

This fixes #4218 in JRuby 9K.

In 06f0441 (JRUBY-6892) Enumerable#drop was changed to call #dup on every element that ended up in the result, but that might not work. Not all objects correctly implement #dup, or are even allocatable.

#take was not changed, and looking at the differences between #take and #drop the only thing that stood out was that the signature of the #each call was different. Changing from Signature.NO_ARGUMENTS to Signature.ONE_REQUIRED make the issue that 06f0441 tried to fix go away.

@iconara iconara Don't dup every element in Enumerator#drop
In 06f0441 (JRUBY-6892) Enumerable#drop was changed to call #dup on every element that ended up in the result, but that might not work. Not all objects correctly implement #dup, or are even allocatable.

#take was not changed, and looking at the differences between #take and #drop the only thing that stood out was that the signature of the #each call was different. Changing from Signature.NO_ARGUMENTS to Signature.ONE_REQUIRED make the issue that 06f0441 tried to fix go away.
6996e2e
@iconara iconara changed the title from Don't dup every element in Enumerator#drop to Don't dup every element in Enumerator#drop (9K) Oct 13, 2016
@kares kares added this to the JRuby 9.1.6.0 milestone Oct 18, 2016
@headius headius merged commit 4e775c7 into jruby:master Nov 8, 2016

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build failed
Details
@headius
Member
headius commented Nov 8, 2016

Our CI went red for a while, so I pulled locally and ran a couple suites. Things look good. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment