summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2022-11-10 11:36:24 -0500
committerPeter Zhu <peter@peterzhu.ca>2022-11-10 13:02:50 -0500
commit7ee1cacb84e6b19908ac0e692601447597d40605 (patch)
tree4c1a527fe9c71af4dc96a51436093cf699798a08 /variable.c
parent354791c248d7e21d5b70ded7c548af954491e247 (diff)
downloadruby-7ee1cacb84e6b19908ac0e692601447597d40605.tar.gz
Extract `rb_shape_get_parent` helper
Extract an `rb_shape_get_parent` method instead of continually calling `rb_shape_get_shape_by_id(shape->parent_id)`
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/variable.c b/variable.c
index 2fed1e3512..93abdac454 100644
--- a/variable.c
+++ b/variable.c
@@ -1583,7 +1583,7 @@ iterate_over_shapes_with_callback(rb_shape_t *shape, rb_ivar_foreach_callback_fu
case SHAPE_ROOT:
return;
case SHAPE_IVAR:
- iterate_over_shapes_with_callback(rb_shape_get_shape_by_id(shape->parent_id), callback, itr_data);
+ iterate_over_shapes_with_callback(rb_shape_get_parent(shape), callback, itr_data);
VALUE * iv_list;
switch (BUILTIN_TYPE(itr_data->obj)) {
case T_OBJECT:
@@ -1606,7 +1606,7 @@ iterate_over_shapes_with_callback(rb_shape_t *shape, rb_ivar_foreach_callback_fu
case SHAPE_CAPACITY_CHANGE:
case SHAPE_FROZEN:
case SHAPE_IVAR_UNDEF:
- iterate_over_shapes_with_callback(rb_shape_get_shape_by_id(shape->parent_id), callback, itr_data);
+ iterate_over_shapes_with_callback(rb_shape_get_parent(shape), callback, itr_data);
return;
}
}