]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Optimize logging by skipping hash table search if it's empty.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Sep 2015 10:33:00 +0000 (11:33 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Sep 2015 10:33:00 +0000 (11:33 +0100)
src/libutil/logger.c

index cca21f870cdd6132addae1f3fa4226bcb543a72b..d8e78ae63a3424797697cf9101bb6c1d7b65ad8a 100644 (file)
@@ -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;
        }