]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Some optimization
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 8 May 2022 11:06:42 +0000 (12:06 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 8 May 2022 11:06:42 +0000 (12:06 +0100)
src/libserver/symcache/symcache_runtime.cxx

index e0941184536860705e4aa2e3e937b8ac6ca1604d..b433213ed0ee7f6a5d67986a9726a13146c4c5ae 100644 (file)
@@ -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];