utc_offset_arg: 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
1c0a97bfad
commit
ce6be8889f
Notes:
git
2025-04-09 13:49:37 +00:00
5
time.c
5
time.c
@ -2079,8 +2079,7 @@ utc_offset_arg(VALUE arg)
|
||||
int n = 0;
|
||||
char *s = RSTRING_PTR(tmp);
|
||||
if (!rb_enc_str_asciicompat_p(tmp)) {
|
||||
invalid_utc_offset:
|
||||
return Qnil;
|
||||
goto invalid_utc_offset;
|
||||
}
|
||||
switch (RSTRING_LEN(tmp)) {
|
||||
case 1:
|
||||
@ -2131,6 +2130,8 @@ utc_offset_arg(VALUE arg)
|
||||
else {
|
||||
return num_exact(arg);
|
||||
}
|
||||
invalid_utc_offset:
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user