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
Closed

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

DawidJanczak opened this issue Oct 28, 2013 · 2 comments
Milestone

Comments

@DawidJanczak
Copy link

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

@enebo
Copy link
Member

@enebo 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
Copy link
Author

@DawidJanczak 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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants