Commit a21088b2 authored by Jun Hiroe's avatar Jun Hiroe

Refactor Enumerable#any?

parent b9632bce
......@@ -48,23 +48,20 @@ module Enumerable
#
# ISO 15.3.2.2.2
def any?(&block)
st = false
if block
self.each{|val|
if block.call(val)
st = true
break
return true
end
}
else
self.each{|val|
if val
st = true
break
return true
end
}
end
st
false
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