Refactor rb_shape_get_next to return an ID

Also rename it, and change parameters to be consistent with
other transition functions.
This commit is contained in:
Jean Boussier 2025-05-08 20:47:51 +02:00
parent e0200cfba0
commit c9b08882b7
Notes: git 2025-05-09 08:23:08 +00:00
8 changed files with 17 additions and 23 deletions

View file

@ -1639,7 +1639,8 @@ general_ivar_set(VALUE obj, ID id, VALUE val, void *data,
rb_raise(rb_eArgError, "too many instance variables");
}
rb_shape_t *next_shape = rb_shape_get_next(current_shape, obj, id);
shape_id_t next_shape_id = rb_shape_transition_add_ivar(obj, id);
rb_shape_t *next_shape = RSHAPE(next_shape_id);
if (UNLIKELY(rb_shape_too_complex_p(next_shape))) {
transition_too_complex_func(obj, data);
goto too_complex;