summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-22 11:33:00 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-22 11:33:00 +0100
commitc532376ab181c7bd700b09353dcc154ee8f5d9e7 (patch)
tree07a95f30fb83ec27006aa3031b7ddd1f2ae9404b /src
parent662ca2f0a44c1d9a38f1b7573ee043f04e83eac8 (diff)
downloadrspamd-c532376ab181c7bd700b09353dcc154ee8f5d9e7.tar.gz
rspamd-c532376ab181c7bd700b09353dcc154ee8f5d9e7.zip
Optimize logging by skipping hash table search if it's empty.
Diffstat (limited to 'src')
-rw-r--r--src/libutil/logger.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libutil/logger.c b/src/libutil/logger.c
index cca21f870..d8e78ae63 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;
}