diff options
author | 卜部昌平 <[email protected]> | 2020-04-08 13:28:13 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-08 13:28:13 +0900 |
commit | 9e6e39c3512f7a962c44dc3729c98a0f8be90341 (patch) | |
tree | 901a22676d54d78240e450b64a8cd06eb1703910 /range.c | |
parent | 5ac4bf2cd87e1eb5779ca5ae7f96a1a22e8436d9 (diff) |
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
Notes
Notes:
Merged-By: shyouhei <[email protected]>
Diffstat (limited to 'range.c')
-rw-r--r-- | range.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -9,7 +9,7 @@ **********************************************************************/ -#include "ruby/config.h" +#include "ruby/3/config.h" #include <assert.h> #include <math.h> @@ -1001,7 +1001,7 @@ first_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, cbarg)) } rb_ary_push(ary[1], i); n--; - ary[0] = INT2NUM(n); + ary[0] = LONG2NUM(n); return Qnil; } @@ -1554,7 +1554,7 @@ r_cover_range_p(VALUE range, VALUE beg, VALUE end, VALUE val) if (!NIL_P(end) && NIL_P(val_end)) return FALSE; if (!NIL_P(beg) && NIL_P(val_beg)) return FALSE; - if (!NIL_P(val_beg) && !NIL_P(val_end) && r_less(val_beg, val_end) > -EXCL(val)) return FALSE; + if (!NIL_P(val_beg) && !NIL_P(val_end) && r_less(val_beg, val_end) > (EXCL(val) ? -1 : 0)) return FALSE; if (!NIL_P(val_beg) && !r_cover_p(range, beg, end, val_beg)) return FALSE; cmp_end = r_less(end, val_end); |