Enumerable#find_index to support multiple values

parent 64805957
...@@ -603,13 +603,13 @@ module Enumerable ...@@ -603,13 +603,13 @@ module Enumerable
idx = 0 idx = 0
if block if block
self.each do |e| self.each do |*e|
return idx if block.call(e) return idx if block.call(*e)
idx += 1 idx += 1
end end
else else
self.each do |e| self.each do |*e|
return idx if e == val return idx if e.__svalue == val
idx += 1 idx += 1
end end
end end
......
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