Use static variables in Range#minmax

This commit is contained in:
Jeremy Evans 2020-07-04 10:12:02 -07:00
Родитель c4bdb6428e
Коммит c146362555
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -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)
);
}