diff options
-rw-r--r-- | enum.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -281,10 +281,12 @@ find_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop)) * (1..100).detect #=> #<Enumerator: 1..100:detect> * (1..100).find #=> #<Enumerator: 1..100:find> * - * (1..10).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> nil - * (1..10).find { |i| i % 5 == 0 and i % 7 == 0 } #=> nil - * (1..100).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> 35 - * (1..100).find { |i| i % 5 == 0 and i % 7 == 0 } #=> 35 + * (1..10).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> nil + * (1..10).find { |i| i % 5 == 0 and i % 7 == 0 } #=> nil + * (1..10).detect(-> {0}) { |i| i % 5 == 0 and i % 7 == 0 } #=> 0 + * (1..10).find(-> {0}) { |i| i % 5 == 0 and i % 7 == 0 } #=> 0 + * (1..100).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> 35 + * (1..100).find { |i| i % 5 == 0 and i % 7 == 0 } #=> 35 * */ |