summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-07-28 13:40:30 +0900
committerKoichi Sasada <ko1@atdot.net>2021-07-29 00:56:48 +0900
commitfa0279d947c3962c3f8c32852278d3ebb964cb19 (patch)
tree5095684bf9af2bb0b61f0c00443433a80193a2e4
parentfb4cf204a662a8cd9dafef6f31f2bd0db9129abe (diff)
should not share same `def` for specialized method
Because the key of redefine table is `def`, `def` should be unique for each optimized method (`alias` is not allowed).
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4493
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/array.c b/array.c
index 3cb57a0872..36f712bcac 100644
--- a/array.c
+++ b/array.c
@@ -8384,7 +8384,7 @@ Init_Array(void)
rb_define_method(rb_cArray, "each_index", rb_ary_each_index, 0);
rb_define_method(rb_cArray, "reverse_each", rb_ary_reverse_each, 0);
rb_define_method(rb_cArray, "length", rb_ary_length, 0);
- rb_define_alias(rb_cArray, "size", "length");
+ rb_define_method(rb_cArray, "size", rb_ary_length, 0);
rb_define_method(rb_cArray, "empty?", rb_ary_empty_p, 0);
rb_define_method(rb_cArray, "find_index", rb_ary_index, -1);
rb_define_method(rb_cArray, "index", rb_ary_index, -1);