summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-24 17:42:29 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-24 17:42:29 +0900
commit3af373285b47d0fbb7ac1ccd6e007c6717d495b8 (patch)
treef5937d19963cc41b3b01998fcd14d46fab271cb2 /variable.c
parent298221dfe56c905800967ab7dbe4cf74cecdc531 (diff)
downloadruby-3af373285b47d0fbb7ac1ccd6e007c6717d495b8.tar.gz
Adjust indents [ci skip]
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c71
1 files changed, 34 insertions, 37 deletions
diff --git a/variable.c b/variable.c
index 5643edb3cc..4c5ae2c112 100644
--- a/variable.c
+++ b/variable.c
@@ -1493,32 +1493,28 @@ rb_shape_set_shape_id(VALUE obj, shape_id_t shape_id)
#else
switch (BUILTIN_TYPE(obj)) {
case T_OBJECT:
- ROBJECT_SET_SHAPE_ID(obj, shape_id);
- break;
+ ROBJECT_SET_SHAPE_ID(obj, shape_id);
+ break;
case T_CLASS:
case T_MODULE:
- {
- RCLASS_EXT(obj)->shape_id = shape_id;
- break;
- }
+ RCLASS_EXT(obj)->shape_id = shape_id;
+ break;
default:
- {
- if (shape_id != FROZEN_ROOT_SHAPE_ID) {
- struct gen_ivtbl *ivtbl = 0;
- RB_VM_LOCK_ENTER();
- {
- st_table* global_iv_table = generic_ivtbl(obj, 0, false);
-
- if (st_lookup(global_iv_table, obj, (st_data_t *)&ivtbl)) {
- ivtbl->shape_id = shape_id;
- }
- else {
- rb_bug("Expected shape_id entry in global iv table");
- }
- }
- RB_VM_LOCK_LEAVE();
- }
- }
+ if (shape_id != FROZEN_ROOT_SHAPE_ID) {
+ struct gen_ivtbl *ivtbl = 0;
+ RB_VM_LOCK_ENTER();
+ {
+ st_table* global_iv_table = generic_ivtbl(obj, 0, false);
+
+ if (st_lookup(global_iv_table, obj, (st_data_t *)&ivtbl)) {
+ ivtbl->shape_id = shape_id;
+ }
+ else {
+ rb_bug("Expected shape_id entry in global iv table");
+ }
+ }
+ RB_VM_LOCK_LEAVE();
+ }
}
#endif
@@ -1604,21 +1600,22 @@ typedef int rb_ivar_foreach_callback_func(ID key, VALUE val, st_data_t arg);
st_data_t rb_st_nth_key(st_table *tab, st_index_t index);
static void
-iterate_over_shapes_with_callback(rb_shape_t *shape, VALUE* iv_list, rb_ivar_foreach_callback_func *callback, st_data_t arg) {
+iterate_over_shapes_with_callback(rb_shape_t *shape, VALUE* iv_list, rb_ivar_foreach_callback_func *callback, st_data_t arg)
+{
switch ((enum shape_type)shape->type) {
- case SHAPE_ROOT:
- return;
- case SHAPE_IVAR:
- iterate_over_shapes_with_callback(rb_shape_get_shape_by_id(shape->parent_id), iv_list, callback, arg);
- VALUE val = iv_list[shape->next_iv_index - 1];
- if (val != Qundef) {
- callback(shape->edge_name, val, arg);
- }
- return;
- case SHAPE_IVAR_UNDEF:
- case SHAPE_FROZEN:
- iterate_over_shapes_with_callback(rb_shape_get_shape_by_id(shape->parent_id), iv_list, callback, arg);
- return;
+ case SHAPE_ROOT:
+ return;
+ case SHAPE_IVAR:
+ iterate_over_shapes_with_callback(rb_shape_get_shape_by_id(shape->parent_id), iv_list, callback, arg);
+ VALUE val = iv_list[shape->next_iv_index - 1];
+ if (val != Qundef) {
+ callback(shape->edge_name, val, arg);
+ }
+ return;
+ case SHAPE_IVAR_UNDEF:
+ case SHAPE_FROZEN:
+ iterate_over_shapes_with_callback(rb_shape_get_shape_by_id(shape->parent_id), iv_list, callback, arg);
+ return;
}
}