diff --git a/enum.c b/enum.c index c25b17f383..5b1e3c27e5 100644 --- a/enum.c +++ b/enum.c @@ -281,10 +281,12 @@ find_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop)) * (1..100).detect #=> # * (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 * */