ruby-changes:47095
From: normal <ko1@a...>
Date: Fri, 30 Jun 2017 07:40:41 +0900 (JST)
Subject: [ruby-changes:47095] normal:r59210 (trunk): array.c: more predefined IDs
normal 2017-06-30 07:40:36 +0900 (Fri, 30 Jun 2017) New Revision: 59210 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59210 Log: array.c: more predefined IDs * array.c (id_cmp): change to macro for OPTIMIZED_CMP (rb_ary_repeated_permutation_size): s/id_power/idPow/ (Init_Array): remove id_cmp and id_power Modified files: trunk/array.c Index: array.c =================================================================== --- array.c (revision 59209) +++ array.c (revision 59210) @@ -25,7 +25,10 @@ https://github.com/ruby/ruby/blob/trunk/array.c#L25 VALUE rb_cArray; -static ID id_cmp, id_div, id_power; +static ID id_div; + +/* for OPTIMIZED_CMP: */ +#define id_cmp idCmp #define ARY_DEFAULT_SIZE 16 #define ARY_MAX_SIZE (LONG_MAX / (int)sizeof(VALUE)) @@ -5310,7 +5313,7 @@ rb_ary_repeated_permutation_size(VALUE a https://github.com/ruby/ruby/blob/trunk/array.c#L5313 } v = LONG2NUM(k); - return rb_funcallv(LONG2NUM(n), id_power, 1, &v); + return rb_funcallv(LONG2NUM(n), idPow, 1, &v); } /* @@ -6259,8 +6262,6 @@ Init_Array(void) https://github.com/ruby/ruby/blob/trunk/array.c#L6262 rb_define_method(rb_cArray, "dig", rb_ary_dig, -1); rb_define_method(rb_cArray, "sum", rb_ary_sum, -1); - id_cmp = rb_intern("<=>"); id_random = rb_intern("random"); id_div = rb_intern("div"); - id_power = rb_intern("**"); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/