chiark / gitweb /
Simplify the if cases for timezone checking
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 17 Sep 2017 07:10:03 +0000 (09:10 +0200)
committerSven Eden <yamakuzure@gmx.net>
Sun, 17 Sep 2017 07:10:03 +0000 (09:10 +0200)
Just to reduce the indentation a bit.

src/basic/time-util.c

index 4b2b4f03530fa3b37278473970628dcd3c482538..c1621df96e20d67e7b6566c0b3c10be771647bc7 100644 (file)
@@ -904,12 +904,8 @@ int parse_timestamp(const char *t, usec_t *usec) {
         pid_t pid;
 
         last_space = strrchr(t, ' ');
-
-        if (last_space != NULL) {
-                if (timezone_is_valid(last_space + 1)) {
-                        timezone = last_space + 1;
-                }
-        }
+        if (last_space != NULL && timezone_is_valid(last_space + 1))
+                timezone = last_space + 1;
 
         if (timezone == NULL || endswith_no_case(t, " UTC"))
                 return parse_timestamp_impl(t, usec, false);