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

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
Copy link

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.

Copy link
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.

enebo added a commit that referenced this issue Nov 5, 2013

@enebo enebo closed this in 8d22538 Nov 5, 2013

@DawidJanczak

This comment has been minimized.

Copy link
Author

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
You can’t perform that action at this time.