Refactor rb_shape_transition_shape_remove_ivar
to not take a shape pointer
It's more consistent with other transition functions.
This commit is contained in:
parent
3f7c0af051
commit
e0200cfba0
Notes:
git
2025-05-09 08:23:08 +00:00
4
shape.c
4
shape.c
@ -645,8 +645,10 @@ remove_shape_recursive(rb_shape_t *shape, ID id, rb_shape_t **removed_shape)
|
||||
}
|
||||
|
||||
bool
|
||||
rb_shape_transition_shape_remove_ivar(VALUE obj, ID id, rb_shape_t *shape, VALUE *removed)
|
||||
rb_shape_transition_remove_ivar(VALUE obj, ID id, VALUE *removed)
|
||||
{
|
||||
rb_shape_t *shape = rb_shape_get_shape(obj);
|
||||
|
||||
if (UNLIKELY(rb_shape_too_complex_p(shape))) {
|
||||
return false;
|
||||
}
|
||||
|
2
shape.h
2
shape.h
@ -167,7 +167,7 @@ rb_shape_t *rb_shape_get_shape(VALUE obj);
|
||||
bool rb_shape_frozen_shape_p(rb_shape_t *shape);
|
||||
shape_id_t rb_shape_transition_frozen(VALUE obj);
|
||||
shape_id_t rb_shape_transition_complex(VALUE obj);
|
||||
bool rb_shape_transition_shape_remove_ivar(VALUE obj, ID id, rb_shape_t *shape, VALUE *removed);
|
||||
bool rb_shape_transition_remove_ivar(VALUE obj, ID id, VALUE *removed);
|
||||
rb_shape_t *rb_shape_get_next(rb_shape_t *shape, VALUE obj, ID id);
|
||||
rb_shape_t *rb_shape_get_next_no_warnings(rb_shape_t *shape, VALUE obj, ID id);
|
||||
rb_shape_t *rb_shape_object_id_shape(VALUE obj);
|
||||
|
@ -1460,13 +1460,11 @@ rb_ivar_delete(VALUE obj, ID id, VALUE undef)
|
||||
rb_check_frozen(obj);
|
||||
|
||||
VALUE val = undef;
|
||||
rb_shape_t *shape = rb_shape_get_shape(obj);
|
||||
|
||||
if (BUILTIN_TYPE(obj) == T_CLASS || BUILTIN_TYPE(obj) == T_MODULE) {
|
||||
IVAR_ACCESSOR_SHOULD_BE_MAIN_RACTOR(id);
|
||||
}
|
||||
|
||||
if (!rb_shape_transition_shape_remove_ivar(obj, id, shape, &val)) {
|
||||
if (!rb_shape_transition_remove_ivar(obj, id, &val)) {
|
||||
if (!rb_shape_obj_too_complex_p(obj)) {
|
||||
rb_evict_fields_to_hash(obj);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user