Array#split preserving the calling array #12839

Merged
merged 1 commit into from Nov 11, 2013

Conversation

Projects
None yet
2 participants
Contributor

kuldeepaggarwal commented Nov 11, 2013

Before:
a = [1, 2, 3, 4, 5]
a.split(3) # => [[1, 2], [4, 5]]
puts a # => []

Result: #split() does not preserve the original array [1, 2, 3, 4, 5].

After:
a = [1, 2, 3, 4, 5]
a.split(3) # => [[1, 2], [4, 5]]
puts a # => [1, 2, 3, 4, 5]

Owner

guilleiguaran commented Nov 11, 2013

Thanks, I've verified that this was a bug introduced in master and 4-0-stable is fine.

guilleiguaran merged commit 5b12213 into rails:master Nov 11, 2013

1 check was pending

default The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment