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.
This commit is contained in:
parent
ed6938ef50
commit
fd0e935886
Notes:
git
2020-06-29 11:06:39 +09:00
6
time.c
6
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: */
|
||||
|
Loading…
x
Reference in New Issue
Block a user