]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Move checks to the correct branch
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 2 Nov 2022 21:45:00 +0000 (21:45 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 2 Nov 2022 21:45:00 +0000 (21:45 +0000)
src/libmime/scan_result.c

index 137f30ca0234f60fe0c8520731248f7572f080df..e160d34a7b8f825aed98fda8b7e7fb7ec777ac53 100644 (file)
@@ -319,9 +319,6 @@ insert_metric_result (struct rspamd_task *task,
                }
                else {
                        if (sdef) {
-                               max_shots = sdef->nshots;
-                       }
-                       else {
                                if (sdef->groups) {
                                        PTR_ARRAY_FOREACH(sdef->groups, i, gr) {
                                                if (gr->flags & RSPAMD_SYMBOL_GROUP_ONE_SHOT) {
@@ -329,9 +326,11 @@ insert_metric_result (struct rspamd_task *task,
                                                }
                                        }
                                }
-                               else {
-                                       max_shots = task->cfg->default_max_shots;
-                               }
+
+                               max_shots = MIN(max_shots, sdef->nshots);
+                       }
+                       else {
+                               max_shots = task->cfg->default_max_shots;
                        }
                }