]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
time-util: drop redundant else
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 13 Feb 2023 18:43:58 +0000 (03:43 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 23 Feb 2023 23:55:27 +0000 (08:55 +0900)
src/basic/time-util.c

index f563b8560cf28e6aed3836a656eb91f29f529a33..54624afda14815be1ecd94571500706819974f2d 100644 (file)
@@ -665,21 +665,23 @@ static int parse_timestamp_impl(const char *t, usec_t *ret, bool with_tz) {
                 if (streq(t, "now"))
                         goto finish;
 
-                else if (t[0] == '+') {
+                if (t[0] == '+') {
                         r = parse_sec(t+1, &plus);
                         if (r < 0)
                                 return r;
 
                         goto finish;
+                }
 
-                } else if (t[0] == '-') {
+                if (t[0] == '-') {
                         r = parse_sec(t+1, &minus);
                         if (r < 0)
                                 return r;
 
                         goto finish;
+                }
 
-                } else if ((k = endswith(t, " ago"))) {
+                if ((k = endswith(t, " ago"))) {
                         t = strndupa_safe(t, k - t);
 
                         r = parse_sec(t, &minus);
@@ -687,8 +689,9 @@ static int parse_timestamp_impl(const char *t, usec_t *ret, bool with_tz) {
                                 return r;
 
                         goto finish;
+                }
 
-                } else if ((k = endswith(t, " left"))) {
+                if ((k = endswith(t, " left"))) {
                         t = strndupa_safe(t, k - t);
 
                         r = parse_sec(t, &plus);