[前][次][番号順一覧][スレッド一覧]

ruby-changes:62122

From: Jeremy <ko1@a...>
Date: Sun, 5 Jul 2020 05:35:00 +0900 (JST)
Subject: [ruby-changes:62122] c146362555 (master): Use static variables in Range#minmax

https://git.ruby-lang.org/ruby.git/commit/?id=c146362555

From c1463625555b061a2b94c3b6c5581730b482a285 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Sat, 4 Jul 2020 10:12:02 -0700
Subject: Use static variables in Range#minmax


diff --git a/range.c b/range.c
index 65e863c..59cae0a 100644
--- a/range.c
+++ b/range.c
@@ -32,6 +32,8 @@ VALUE rb_cRange; https://github.com/ruby/ruby/blob/trunk/range.c#L32
 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) https://github.com/ruby/ruby/blob/trunk/range.c#L1269
         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)
     );
 }
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]