From 5941112e7e92d4afd8a6a6c21b7bfa91012b09f7 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 9 Dec 2020 01:21:31 +0900 Subject: [PATCH] log: merge conditions to reduce indentation --- src/basic/log.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/basic/log.c b/src/basic/log.c index d4054cf46a..5a87ad3c72 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -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) {