1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Adjust indents [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2022-10-24 17:42:29 +09:00
parent 298221dfe5
commit 3af373285b
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -1493,32 +1493,28 @@ rb_shape_set_shape_id(VALUE obj, shape_id_t shape_id)
#else #else
switch (BUILTIN_TYPE(obj)) { switch (BUILTIN_TYPE(obj)) {
case T_OBJECT: case T_OBJECT:
ROBJECT_SET_SHAPE_ID(obj, shape_id); ROBJECT_SET_SHAPE_ID(obj, shape_id);
break; break;
case T_CLASS: case T_CLASS:
case T_MODULE: case T_MODULE:
{ RCLASS_EXT(obj)->shape_id = shape_id;
RCLASS_EXT(obj)->shape_id = shape_id; break;
break;
}
default: default:
{ if (shape_id != FROZEN_ROOT_SHAPE_ID) {
if (shape_id != FROZEN_ROOT_SHAPE_ID) { struct gen_ivtbl *ivtbl = 0;
struct gen_ivtbl *ivtbl = 0; RB_VM_LOCK_ENTER();
RB_VM_LOCK_ENTER(); {
{ st_table* global_iv_table = generic_ivtbl(obj, 0, false);
st_table* global_iv_table = generic_ivtbl(obj, 0, false);
if (st_lookup(global_iv_table, obj, (st_data_t *)&ivtbl)) { if (st_lookup(global_iv_table, obj, (st_data_t *)&ivtbl)) {
ivtbl->shape_id = shape_id; ivtbl->shape_id = shape_id;
} }
else { else {
rb_bug("Expected shape_id entry in global iv table"); rb_bug("Expected shape_id entry in global iv table");
} }
} }
RB_VM_LOCK_LEAVE(); RB_VM_LOCK_LEAVE();
} }
}
} }
#endif #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); st_data_t rb_st_nth_key(st_table *tab, st_index_t index);
static void 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) { switch ((enum shape_type)shape->type) {
case SHAPE_ROOT: case SHAPE_ROOT:
return; return;
case SHAPE_IVAR: case SHAPE_IVAR:
iterate_over_shapes_with_callback(rb_shape_get_shape_by_id(shape->parent_id), iv_list, callback, arg); 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]; VALUE val = iv_list[shape->next_iv_index - 1];
if (val != Qundef) { if (val != Qundef) {
callback(shape->edge_name, val, arg); callback(shape->edge_name, val, arg);
} }
return; return;
case SHAPE_IVAR_UNDEF: case SHAPE_IVAR_UNDEF:
case SHAPE_FROZEN: case SHAPE_FROZEN:
iterate_over_shapes_with_callback(rb_shape_get_shape_by_id(shape->parent_id), iv_list, callback, arg); iterate_over_shapes_with_callback(rb_shape_get_shape_by_id(shape->parent_id), iv_list, callback, arg);
return; return;
} }
} }