mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ibf_dump_object_object: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
This commit is contained in:
parent
a8d992ac00
commit
9c92dcf366
Notes:
git
2020-06-29 11:07:10 +09:00
1 changed files with 4 additions and 8 deletions
12
compile.c
12
compile.c
|
@ -11610,12 +11610,9 @@ ibf_dump_object_object(struct ibf_dump *dump, VALUE obj)
|
|||
IBF_W_ALIGN(ibf_offset_t);
|
||||
current_offset = ibf_dump_pos(dump);
|
||||
|
||||
if (SPECIAL_CONST_P(obj)) {
|
||||
if (RB_TYPE_P(obj, T_SYMBOL) ||
|
||||
RB_TYPE_P(obj, T_FLOAT)) {
|
||||
obj_header.internal = FALSE;
|
||||
goto dump_object;
|
||||
}
|
||||
if (SPECIAL_CONST_P(obj) &&
|
||||
! (RB_TYPE_P(obj, T_SYMBOL) ||
|
||||
RB_TYPE_P(obj, T_FLOAT))) {
|
||||
obj_header.special_const = TRUE;
|
||||
obj_header.frozen = TRUE;
|
||||
obj_header.internal = TRUE;
|
||||
|
@ -11623,8 +11620,7 @@ ibf_dump_object_object(struct ibf_dump *dump, VALUE obj)
|
|||
ibf_dump_write_small_value(dump, obj);
|
||||
}
|
||||
else {
|
||||
obj_header.internal = (RBASIC_CLASS(obj) == 0) ? TRUE : FALSE;
|
||||
dump_object:
|
||||
obj_header.internal = SPECIAL_CONST_P(obj) ? FALSE : (RBASIC_CLASS(obj) == 0) ? TRUE : FALSE;
|
||||
obj_header.special_const = FALSE;
|
||||
obj_header.frozen = FL_TEST(obj, FL_FREEZE) ? TRUE : FALSE;
|
||||
ibf_dump_object_object_header(dump, obj_header);
|
||||
|
|
Loading…
Add table
Reference in a new issue