diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-09-25 13:51:06 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-09-30 10:26:38 +0900 |
commit | 7cb96d41a52d5ce4b2485ff542edc88fa246bc1a (patch) | |
tree | dc13c02edcd942d8bf0aa67bbf1fd262cfcc0f41 /vm_method.c | |
parent | 3207979278bea11c50cb84f4044047b9c503230b (diff) |
refactor delete rb_method_entry_copy
The deleted function was to destructively overwrite existing method
entries, which is now considered to be a bad idea. Delete it, and
assign a newly created method entry instead.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2486
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/vm_method.c b/vm_method.c index 7bb675ebcc..6d052220c2 100644 --- a/vm_method.c +++ b/vm_method.c @@ -546,17 +546,6 @@ rb_method_entry_complement_defined_class(const rb_method_entry_t *src_me, ID cal return (rb_callable_method_entry_t *)me; } -void -rb_method_entry_copy(rb_method_entry_t *dst, const rb_method_entry_t *src) -{ - *(rb_method_definition_t **)&dst->def = method_definition_addref(src->def); - method_definition_reset(dst); - dst->called_id = src->called_id; - RB_OBJ_WRITE((VALUE)dst, &dst->owner, src->owner); - RB_OBJ_WRITE((VALUE)dst, &dst->defined_class, src->defined_class); - METHOD_ENTRY_FLAGS_COPY(dst, src); -} - static rb_method_entry_t* make_method_entry_refined(VALUE owner, rb_method_entry_t *me) { |