]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: skip get_gmtime where tm is unused
authorRobin H. Johnson <robbat2@gentoo.org>
Wed, 10 Apr 2019 21:08:15 +0000 (21:08 +0000)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Apr 2019 12:58:32 +0000 (14:58 +0200)
For LOG_FMT_TS (%Ts), the tm variable is not used, so save some cycles
on the call to get_gmtime.

Backport: 1.9 1.8
Signed-off-by: Robin H. Johnson <rjohnson@digitalocean.com>
src/log.c

index f8d3414e2b5cf1d3ae09a314852940e20f54b039..39e472b3309f23f2cdbd12417b1b9bbd9b1ba4bd 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -2019,7 +2019,6 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
                                break;
 
                        case LOG_FMT_TS: // %Ts
-                               get_gmtime(logs->accept_date.tv_sec, &tm);
                                if (tmp->options & LOG_OPT_HEXA) {
                                        iret = snprintf(tmplog, dst + maxsize - tmplog, "%04X", (unsigned int)logs->accept_date.tv_sec);
                                        if (iret < 0 || iret > dst + maxsize - tmplog)