Skip to content

Commit

Permalink
return from first i() if n is equal and less than zero, because rb_it…
Browse files Browse the repository at this point in the history
…er_break() does not return like CRuby. fix #1496
  • Loading branch information
Watson1978 committed Apr 6, 2012
1 parent cf2d056 commit 33add5d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions range.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ first_i(VALUE i, VALUE *ary)

if (n <= 0) {
rb_iter_break();
return Qnil;
}
rb_ary_push(ary[1], i);
n--;
Expand Down

0 comments on commit 33add5d

Please sign in to comment.