summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-29 22:40:36 (GMT)
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-29 22:40:36 (GMT)
commit940fa3b824f9661d7ca8b023da398a2de0108c3b (patch)
tree28b9d8ea0f576982434a9ef043c55e0916730062 /array.c
parent5f51ee3a4baa3c6f8b5233f1d568cbfaaab3349e (diff)
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
Diffstat (limited to 'array.c')
-rw-r--r--array.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/array.c b/array.c
index 278789d..c700c93 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("**");
}