From fd0e93588675982832ee075d11d9953aca97407e 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, 19 Jun 2020 12:59:31 +0900 Subject: [PATCH] time_mload: 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. --- time.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/time.c b/time.c index f07eddb91e..457fac9748 100644 --- a/time.c +++ b/time.c @@ -5328,8 +5328,7 @@ time_mload(VALUE time, VALUE str) StringValue(str); buf = (unsigned char *)RSTRING_PTR(str); if (RSTRING_LEN(str) < base_dump_size) { - invalid_format: - rb_raise(rb_eTypeError, "marshaled time format differ"); + goto invalid_format; } p = s = 0; @@ -5432,6 +5431,9 @@ end_submicro: ; } return time; + + invalid_format: + rb_raise(rb_eTypeError, "marshaled time format differ"); } /* :nodoc: */