mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Refactor rb_shape_transition_frozen
to return a shape_id
.
This commit is contained in:
parent
31d0a5815c
commit
f82523f14b
Notes:
git
2025-05-09 08:23:10 +00:00
4 changed files with 21 additions and 21 deletions
22
shape.c
22
shape.c
|
@ -700,28 +700,28 @@ rb_shape_transition_shape_remove_ivar(VALUE obj, ID id, rb_shape_t *shape, VALUE
|
|||
return true;
|
||||
}
|
||||
|
||||
rb_shape_t *
|
||||
rb_shape_transition_shape_frozen(VALUE obj)
|
||||
shape_id_t
|
||||
rb_shape_transition_frozen(VALUE obj)
|
||||
{
|
||||
rb_shape_t *shape = rb_shape_get_shape(obj);
|
||||
RUBY_ASSERT(shape);
|
||||
RUBY_ASSERT(RB_OBJ_FROZEN(obj));
|
||||
|
||||
if (rb_shape_frozen_shape_p(shape)) {
|
||||
return shape;
|
||||
shape_id_t shape_id = rb_shape_get_shape_id(obj);
|
||||
if (shape_id == ROOT_SHAPE_ID) {
|
||||
return SPECIAL_CONST_SHAPE_ID;
|
||||
}
|
||||
|
||||
rb_shape_t *next_shape;
|
||||
rb_shape_t *shape = RSHAPE(shape_id);
|
||||
RUBY_ASSERT(shape);
|
||||
|
||||
if (shape == rb_shape_get_root_shape()) {
|
||||
return RSHAPE(SPECIAL_CONST_SHAPE_ID);
|
||||
if (rb_shape_frozen_shape_p(shape)) {
|
||||
return shape_id;
|
||||
}
|
||||
|
||||
bool dont_care;
|
||||
next_shape = get_next_shape_internal(shape, id_frozen, SHAPE_FROZEN, &dont_care, true);
|
||||
rb_shape_t *next_shape = get_next_shape_internal(shape, id_frozen, SHAPE_FROZEN, &dont_care, true);
|
||||
|
||||
RUBY_ASSERT(next_shape);
|
||||
return next_shape;
|
||||
return rb_shape_id(next_shape);
|
||||
}
|
||||
|
||||
static rb_shape_t *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue