From 940fa3b824f9661d7ca8b023da398a2de0108c3b Mon Sep 17 00:00:00 2001 From: normal Date: Thu, 29 Jun 2017 22:40:36 +0000 Subject: [PATCH] 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/array.c b/array.c index 278789dfc0..c700c93119 100644 --- a/array.c +++ b/array.c @@ -25,7 +25,10 @@ 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 ary, VALUE args, VALUE eobj) } 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) 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("**"); }