1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use static variables in Range#minmax

This commit is contained in:
Jeremy Evans 2020-07-04 10:12:02 -07:00
parent c4bdb6428e
commit c146362555
Notes: git 2020-07-05 05:35:02 +09:00

View file

@ -32,6 +32,8 @@ VALUE rb_cRange;
static ID id_beg, id_end, id_excl;
#define id_cmp idCmp
#define id_succ idSucc
#define id_min idMin
#define id_max idMax
static VALUE r_cover_p(VALUE, VALUE, VALUE, VALUE);
@ -1267,8 +1269,8 @@ range_minmax(VALUE range)
return rb_call_super(0, NULL);
}
return rb_assoc_new(
rb_funcall(range, rb_intern("min"), 0),
rb_funcall(range, rb_intern("max"), 0)
rb_funcall(range, id_min, 0),
rb_funcall(range, id_max, 0)
);
}