call to_a at the top of Enumerabl#zip; ref #1961

parent c2ad8098
...@@ -630,14 +630,14 @@ module Enumerable ...@@ -630,14 +630,14 @@ module Enumerable
def zip(*arg) def zip(*arg)
ary = [] ary = []
arg = arg.map{|a|a.to_a}
i = 0 i = 0
self.each do |*val| self.each do |*val|
a = [] a = []
a.push(val.__svalue) a.push(val.__svalue)
idx = 0 idx = 0
while idx < arg.size while idx < arg.size
a2 = arg[idx].to_a a.push(arg[idx][i])
a.push(a2[i])
idx += 1 idx += 1
end end
ary.push(a) ary.push(a)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment