aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-05-08 12:06:42 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-05-08 12:06:42 +0100
commit8a944397339627b4ce725c8e3092f8702a4f5fbe (patch)
tree233a2598b52b8e7d8018b61635e7f8ba1a9ab67f
parente02db847faa6f135cf317918888a45c75bd3997b (diff)
downloadrspamd-8a944397339627b4ce725c8e3092f8702a4f5fbe.tar.gz
rspamd-8a944397339627b4ce725c8e3092f8702a4f5fbe.zip
[Minor] Some optimization
-rw-r--r--src/libserver/symcache/symcache_runtime.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libserver/symcache/symcache_runtime.cxx b/src/libserver/symcache/symcache_runtime.cxx
index e09411845..b433213ed 100644
--- a/src/libserver/symcache/symcache_runtime.cxx
+++ b/src/libserver/symcache/symcache_runtime.cxx
@@ -426,7 +426,11 @@ symcache_runtime::process_filters(struct rspamd_task *task, symcache &cache, int
for (const auto [idx, item] : rspamd::enumerate(order->d)) {
/* Exclude all non filters */
if (item->type != symcache_item_type::FILTER) {
- continue;
+ /*
+ * We use breaking the loop as we append non-filters to the end of the list
+ * so, it is safe to stop processing immediately
+ */
+ break;
}
auto dyn_item = &dynamic_items[idx];