From: Yu Watanabe Date: Mon, 13 Feb 2023 18:43:58 +0000 (+0900) Subject: time-util: drop redundant else X-Git-Tag: v254-rc1~1163^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17d1ebfc43c3b971d20ff2806acc634ee153eef6;p=thirdparty%2Fsystemd.git time-util: drop redundant else --- diff --git a/src/basic/time-util.c b/src/basic/time-util.c index f563b8560cf..54624afda14 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -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);