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

ruby-changes:33138

From: nobu <ko1@a...>
Date: Sat, 1 Mar 2014 00:47:56 +0900 (JST)
Subject: [ruby-changes:33138] nobu:r45217 (trunk): numeric.c: predefined constants

nobu	2014-03-01 00:47:52 +0900 (Sat, 01 Mar 2014)

  New Revision: 45217

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

  Log:
    numeric.c: predefined constants
    
    * numeric.c (id_eq, id_cmp): use predefined constants in id.h.

  Modified files:
    trunk/numeric.c
Index: numeric.c
===================================================================
--- numeric.c	(revision 45216)
+++ numeric.c	(revision 45217)
@@ -109,7 +109,9 @@ static VALUE fix_uminus(VALUE num); https://github.com/ruby/ruby/blob/trunk/numeric.c#L109
 static VALUE fix_mul(VALUE x, VALUE y);
 static VALUE int_pow(long x, unsigned long y);
 
-static ID id_coerce, id_to_i, id_eq, id_div, id_cmp;
+static ID id_coerce, id_to_i, id_div;
+#define id_eq  idEq
+#define id_cmp idCmp
 
 VALUE rb_cNumeric;
 VALUE rb_cFloat;
@@ -3849,9 +3851,7 @@ Init_Numeric(void) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3851
 #endif
     id_coerce = rb_intern("coerce");
     id_to_i = rb_intern("to_i");
-    id_eq = rb_intern("==");
     id_div = rb_intern("div");
-    id_cmp = rb_intern("<=>");
 
     rb_eZeroDivError = rb_define_class("ZeroDivisionError", rb_eStandardError);
     rb_eFloatDomainError = rb_define_class("FloatDomainError", rb_eRangeError);

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

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