diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-19 12:59:31 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-29 11:05:41 +0900 |
commit | fd0e93588675982832ee075d11d9953aca97407e (patch) | |
tree | 4fb7fda01500b9e40ba182b5a7b7b4beebbb7ff6 /time.c | |
parent | ed6938ef5063db1ca82d9c078bb37216b1ea7eba (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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: */ |