]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix some calcs
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Jul 2021 15:14:43 +0000 (16:14 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Jul 2021 15:14:43 +0000 (16:14 +0100)
src/libserver/composites/composites.cxx
src/libserver/composites/composites_internal.hxx
src/libserver/composites/composites_manager.cxx

index b03edaf716eb58177361776db3b26d612b2f8f1c..99a2038c34e7694cd3ccdd23f097c6b49f5a44ef 100644 (file)
@@ -88,7 +88,8 @@ struct composites_data {
 
        explicit composites_data(struct rspamd_task *task, struct rspamd_scan_result *mres) :
                        task(task), composite(nullptr), metric_res(mres) {
-               checked.resize(rspamd_composites_manager_nelts(task->cfg->composites_manager) * 2);
+               checked.resize(rspamd_composites_manager_nelts(task->cfg->composites_manager) * 2,
+                               false);
        }
 };
 
index 12fa3ecb287167d3362545f64b3f7ee5ea73c9e8..c38f3d3771acf6a0bf7cecdbb50796b326eba072 100644 (file)
@@ -57,7 +57,7 @@ public:
        }
 
        auto size(void) const -> std::size_t {
-               return composites.size();
+               return all_composites.size();
        }
 
        auto find(std::string_view name) const -> const rspamd_composite * {
index c2e719c89c297e91c3c26414cd3f8fc561fda5b5..cf91d1136f2a3389250ef97183c59536bc23ff5e 100644 (file)
@@ -87,7 +87,7 @@ composites_manager::add_composite(std::string_view composite_name, const ucl_obj
 
        auto &composite = all_composites.emplace_back(std::make_shared<rspamd_composite>());
        composite->expr = expr;
-       composite->id = all_composites.size();
+       composite->id = all_composites.size() - 1;
        composite->str_expr = composite_expression;
        composite->sym = composite_name;