summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-06-19 12:39:16 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-29 11:05:41 +0900
commit1c0a97bfad9943d796ef9ba5e28c967397a80b77 (patch)
tree6bf65e47ca7989939f9b533039b7b971550f5eed /time.c
parent0fc569361bfef9a48a6ad54b075047f02b51b4e2 (diff)
downloadruby-1c0a97bfad9943d796ef9ba5e28c967397a80b77.tar.gz
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.
Diffstat (limited to 'time.c')
-rw-r--r--time.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/time.c b/time.c
index b45715a24b..6d599d483a 100644
--- a/time.c
+++ b/time.c
@@ -1967,10 +1967,8 @@ vtm_add_offset(struct vtm *vtm, VALUE off, int sign)
vtm->subsecx = subv(vtm->subsecx, INT2FIX(TIME_SCALE));
sec += 1;
}
- goto not_zero_sec;
}
if (sec) {
- not_zero_sec:
/* If sec + subsec == 0, don't change vtm->sec.
* It may be 60 which is a leap second. */
sec += vtm->sec;