зеркало из https://github.com/github/ruby.git
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).
This commit is contained in:
Родитель
fb4cf204a6
Коммит
fa0279d947
2
array.c
2
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче