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:
parent
c4bdb6428e
commit
c146362555
Notes:
git
2020-07-05 05:35:02 +09:00
1 changed files with 4 additions and 2 deletions
6
range.c
6
range.c
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue