]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
log: merge conditions to reduce indentation
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Dec 2020 16:21:31 +0000 (01:21 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 9 Dec 2020 05:44:02 +0000 (14:44 +0900)
src/basic/log.c

index d4054cf46a8e87728d43c0f36ab3643439144d34..5a87ad3c726cc5f4e93947a3cbe2124937405066 100644 (file)
@@ -387,11 +387,10 @@ static int write_to_console(
                 iovec[n++] = IOVEC_MAKE_STRING(prefix);
         }
 
-        if (show_time) {
-                if (format_timestamp(header_time, sizeof(header_time), now(CLOCK_REALTIME))) {
-                        iovec[n++] = IOVEC_MAKE_STRING(header_time);
-                        iovec[n++] = IOVEC_MAKE_STRING(" ");
-                }
+        if (show_time &&
+            format_timestamp(header_time, sizeof(header_time), now(CLOCK_REALTIME))) {
+                iovec[n++] = IOVEC_MAKE_STRING(header_time);
+                iovec[n++] = IOVEC_MAKE_STRING(" ");
         }
 
         if (show_tid) {