Skip to content

Commit e06c74e

Browse files
committed
Refactor class_fields_ivar_set to use imemo_fields_complex_from_obj
1 parent fd59ac6 commit e06c74e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

variable.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4665,12 +4665,7 @@ class_fields_ivar_set(VALUE klass, VALUE fields_obj, ID id, VALUE val, bool conc
46654665

46664666
next_shape_id = rb_shape_transition_add_ivar(fields_obj, id);
46674667
if (UNLIKELY(rb_shape_too_complex_p(next_shape_id))) {
4668-
attr_index_t current_len = RSHAPE_LEN(current_shape_id);
4669-
fields_obj = rb_imemo_fields_new_complex(rb_singleton_class(klass), current_len + 1);
4670-
if (current_len) {
4671-
rb_obj_copy_fields_to_hash_table(original_fields_obj, rb_imemo_fields_complex_tbl(fields_obj));
4672-
RBASIC_SET_SHAPE_ID(fields_obj, next_shape_id);
4673-
}
4668+
fields_obj = imemo_fields_complex_from_obj(rb_singleton_class(klass), fields_obj, next_shape_id);
46744669
goto too_complex;
46754670
}
46764671

0 commit comments

Comments
 (0)