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

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

Projects

None yet

2 participants

@DawidJanczak
[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 in solnic/coercible Oct 28, 2013
Merged

1.8.7 out #9

@enebo
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 enebo closed this in 8d22538 Nov 5, 2013
@DawidJanczak

Thank you @enebo, works perfectly fine.

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