Enumerable#one? to prune iteration when count > 1; ref #1926

parent 2a771760
...@@ -465,6 +465,7 @@ module Enumerable ...@@ -465,6 +465,7 @@ module Enumerable
else else
count += 1 if val.__svalue count += 1 if val.__svalue
end end
return false if count > 1
end end
count == 1 ? true : false count == 1 ? true : false
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