From: Vsevolod Stakhov Date: Tue, 22 Sep 2015 10:33:00 +0000 (+0100) Subject: Optimize logging by skipping hash table search if it's empty. X-Git-Tag: 1.0.1~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c532376ab181c7bd700b09353dcc154ee8f5d9e7;p=thirdparty%2Frspamd.git Optimize logging by skipping hash table search if it's empty. --- diff --git a/src/libutil/logger.c b/src/libutil/logger.c index cca21f870c..d8e78ae63a 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -406,7 +406,9 @@ rspamd_logger_need_log (rspamd_logger_t *rspamd_log, GLogLevelFlags log_level, } if (rspamd_log->cfg->debug_modules != NULL && module != NULL && + g_hash_table_size (rspamd_log->cfg->debug_modules) > 0 && g_hash_table_lookup (rspamd_log->cfg->debug_modules, module)) { + return TRUE; }