vtm_add_offset: 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
0fc569361b
commit
1c0a97bfad
Notes:
git
2020-06-29 11:06:41 +09:00
2
time.c
2
time.c
@ -1967,10 +1967,8 @@ vtm_add_offset(struct vtm *vtm, VALUE off, int sign)
|
|||||||
vtm->subsecx = subv(vtm->subsecx, INT2FIX(TIME_SCALE));
|
vtm->subsecx = subv(vtm->subsecx, INT2FIX(TIME_SCALE));
|
||||||
sec += 1;
|
sec += 1;
|
||||||
}
|
}
|
||||||
goto not_zero_sec;
|
|
||||||
}
|
}
|
||||||
if (sec) {
|
if (sec) {
|
||||||
not_zero_sec:
|
|
||||||
/* If sec + subsec == 0, don't change vtm->sec.
|
/* If sec + subsec == 0, don't change vtm->sec.
|
||||||
* It may be 60 which is a leap second. */
|
* It may be 60 which is a leap second. */
|
||||||
sec += vtm->sec;
|
sec += vtm->sec;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user