From f21370cadf091f7168fb8605a2051b86fc2b14d2 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Thu, 10 Jan 2019 18:44:48 -0800 Subject: libgpsd_core: Short cicuit gpsd_log() on low log level. This saves a bunch of unneeded pushing and popping. --- libgpsd_core.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libgpsd_core.c') diff --git a/libgpsd_core.c b/libgpsd_core.c index e46104ff..92330b7c 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -206,6 +206,11 @@ void gpsd_log(const struct gpsd_errout_t *errout, char buf[BUFSIZ]; va_list ap; + if (errout->debug < errlevel) { + /* nothing to do, get out */ + return; + } + buf[0] = '\0'; va_start(ap, fmt); gpsd_vlog(errout, errlevel, buf, sizeof(buf), fmt, ap); -- cgit v1.2.1