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

Array(array) returns a copy instead of array itself #1176

Closed
DawidJanczak opened this Issue Oct 28, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@DawidJanczak

DawidJanczak commented Oct 28, 2013

[1] pry(main)> arr = [1]
=> [1]
[3] pry(main)> arr.equal? Array(arr)
=> false

The commit that introduced the change: 0ed823a

MRI returns the same object on Array(arr), arr.to_a and arr.to_ary when arr is an Array.
JRuby returns a copy in the first case.

@DawidJanczak DawidJanczak referenced this issue Oct 28, 2013

Merged

1.8.7 out #9

@enebo

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Oct 28, 2013

Member

I am fixing this right now. Simple fix. Only two consumers and I should have noticed Array() was one.

Member

enebo commented Oct 28, 2013

I am fixing this right now. Simple fix. Only two consumers and I should have noticed Array() was one.

@DawidJanczak

This comment has been minimized.

Show comment
Hide comment
@DawidJanczak

DawidJanczak Nov 6, 2013

Thank you @enebo, works perfectly fine.

DawidJanczak commented Nov 6, 2013

Thank you @enebo, works perfectly fine.

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