diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2025-05-27 13:32:55 +0200 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2025-05-27 15:34:02 +0200 |
commit | ccf2b7c5b89ba4b40f9ed4b9eef95d7bd4867538 (patch) | |
tree | c9e03b8ab4e05359aeff6b6ccac814505d733366 /object.c | |
parent | a1f72d23a911d8a1f4c89fbaacee1d8e7b4e90d3 (diff) |
Refactor `rb_shape_too_complex_p` to take a `shape_id_t`.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13450
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -331,7 +331,7 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj) shape_id_t src_shape_id = RBASIC_SHAPE_ID(obj); - if (rb_shape_id_too_complex_p(src_shape_id)) { + if (rb_shape_too_complex_p(src_shape_id)) { rb_shape_copy_complex_ivars(dest, obj, src_shape_id, ROBJECT_FIELDS_HASH(obj)); return; } @@ -343,7 +343,7 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj) RUBY_ASSERT(RSHAPE(initial_shape_id)->type == SHAPE_T_OBJECT); dest_shape_id = rb_shape_rebuild(initial_shape_id, src_shape_id); - if (UNLIKELY(rb_shape_id_too_complex_p(dest_shape_id))) { + if (UNLIKELY(rb_shape_too_complex_p(dest_shape_id))) { st_table *table = rb_st_init_numtable_with_size(src_num_ivs); rb_obj_copy_ivs_to_hash_table(obj, table); rb_obj_init_too_complex(dest, table); @@ -496,7 +496,7 @@ rb_obj_clone_setup(VALUE obj, VALUE clone, VALUE kwfreeze) if (RB_OBJ_FROZEN(obj)) { shape_id_t next_shape_id = rb_shape_transition_frozen(clone); - if (!rb_shape_obj_too_complex_p(clone) && rb_shape_id_too_complex_p(next_shape_id)) { + if (!rb_shape_obj_too_complex_p(clone) && rb_shape_too_complex_p(next_shape_id)) { rb_evict_ivars_to_hash(clone); } else { @@ -520,7 +520,7 @@ rb_obj_clone_setup(VALUE obj, VALUE clone, VALUE kwfreeze) shape_id_t next_shape_id = rb_shape_transition_frozen(clone); // If we're out of shapes, but we want to freeze, then we need to // evacuate this clone to a hash - if (!rb_shape_obj_too_complex_p(clone) && rb_shape_id_too_complex_p(next_shape_id)) { + if (!rb_shape_obj_too_complex_p(clone) && rb_shape_too_complex_p(next_shape_id)) { rb_evict_ivars_to_hash(clone); } else { |