summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-07-04 10:12:02 -0700
committerJeremy Evans <code@jeremyevans.net>2020-07-04 13:34:38 -0700
commitc1463625555b061a2b94c3b6c5581730b482a285 (patch)
tree38d7764d6144f2a658d3e00216aae05765b606c8 /range.c
parentc4bdb6428e046d1f80cbb23b8b0c683bc481979f (diff)
Use static variables in Range#minmax
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3286
Diffstat (limited to 'range.c')
-rw-r--r--range.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/range.c b/range.c
index 65e863c0fb9..59cae0ae34b 100644
--- a/range.c
+++ b/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)
);
}