mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
1 changed files with 4 additions and 2 deletions
6
time.c
6
time.c
|
@ -5328,8 +5328,7 @@ time_mload(VALUE time, VALUE str)
|
||||||
StringValue(str);
|
StringValue(str);
|
||||||
buf = (unsigned char *)RSTRING_PTR(str);
|
buf = (unsigned char *)RSTRING_PTR(str);
|
||||||
if (RSTRING_LEN(str) < base_dump_size) {
|
if (RSTRING_LEN(str) < base_dump_size) {
|
||||||
invalid_format:
|
goto invalid_format;
|
||||||
rb_raise(rb_eTypeError, "marshaled time format differ");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p = s = 0;
|
p = s = 0;
|
||||||
|
@ -5432,6 +5431,9 @@ end_submicro: ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return time;
|
return time;
|
||||||
|
|
||||||
|
invalid_format:
|
||||||
|
rb_raise(rb_eTypeError, "marshaled time format differ");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* :nodoc: */
|
/* :nodoc: */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue