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

ruby-changes:38336

From: nobu <ko1@a...>
Date: Sat, 2 May 2015 07:39:36 +0900 (JST)
Subject: [ruby-changes:38336] nobu:r50417 (trunk): range.c: predefined IDs

nobu	2015-05-02 07:39:14 +0900 (Sat, 02 May 2015)

  New Revision: 50417

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50417

  Log:
    range.c: predefined IDs
    
    * range.c (id_cmp, id_succ): use predefined IDs in id.def.

  Modified files:
    trunk/range.c
Index: range.c
===================================================================
--- range.c	(revision 50416)
+++ range.c	(revision 50417)
@@ -18,7 +18,9 @@ https://github.com/ruby/ruby/blob/trunk/range.c#L18
 #include <math.h>
 
 VALUE rb_cRange;
-static ID id_cmp, id_succ, id_beg, id_end, id_excl, id_integer_p, id_div;
+static ID id_beg, id_end, id_excl, id_integer_p, id_div;
+#define id_cmp idCmp
+#define id_succ idSucc
 
 #define RANGE_BEG(r) (RSTRUCT(r)->as.ary[0])
 #define RANGE_END(r) (RSTRUCT(r)->as.ary[1])
@@ -1330,8 +1332,6 @@ Init_Range(void) https://github.com/ruby/ruby/blob/trunk/range.c#L1332
 #undef rb_intern
 #define rb_intern(str) rb_intern_const(str)
 
-    id_cmp = rb_intern("<=>");
-    id_succ = rb_intern("succ");
     id_beg = rb_intern("begin");
     id_end = rb_intern("end");
     id_excl = rb_intern("excl");

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

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