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

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

Merged
merged 1 commit into from Nov 8, 2016

Conversation

iconara
Copy link
Contributor

@iconara 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.

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 changed the title Don't dup every element in Enumerator#drop 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
@headius
Copy link
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enumerable#drop calls #dup on every element
3 participants