summaryrefslogtreecommitdiff
path: root/shape.c
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-05-08 19:05:03 +0200
committerJean Boussier <[email protected]>2025-05-09 10:22:51 +0200
commitf82523f14bf69f73a4660611a16a67a88a408eda ()
treec6481c2eac6a9a51896d71b6063a0218f8d49915 /shape.c
parent31d0a5815c43b219eca356d0cc7dfedfb0569eca (diff)
Refactor `rb_shape_transition_frozen` to return a `shape_id`.
Notes: Merged: https://.com/ruby/ruby/pull/13283
-rw-r--r--shape.c22
1 files changed, 11 insertions, 11 deletions
@@ -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)
{
- 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;
}
- rb_shape_t *next_shape;
- if (shape == rb_shape_get_root_shape()) {
- return RSHAPE(SPECIAL_CONST_SHAPE_ID);
}
bool dont_care;
- next_shape = get_next_shape_internal(shape, id_frozen, SHAPE_FROZEN, &dont_care, true);
RUBY_ASSERT(next_shape);
- return next_shape;
}
static rb_shape_t *