From 9c92dcf366d2f66a085bd23f0b4934415e1a15b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Fri, 12 Jun 2020 13:57:30 +0900 Subject: 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. --- compile.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index bb9cdc0873..f641cf91ee 100644 --- a/compile.c +++ b/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); -- cgit v1.2.3