]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Remove stupid threshold for saving symbol value
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 15 Dec 2023 14:50:13 +0000 (14:50 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 15 Dec 2023 14:50:13 +0000 (14:50 +0000)
src/controller.c

index 339cf1184d9fd4ee7019c42dc5f426c80d8655d7..f05105e913af3758b9da2f4370593c77e1faf156 100644 (file)
@@ -2414,7 +2414,7 @@ rspamd_controller_handle_savesymbols(
                val = ucl_object_todouble(jvalue);
                sym = g_hash_table_lookup(session->cfg->symbols, ucl_object_tostring(jname));
 
-               if (sym && fabs(*sym->weight_ptr - val) > 0.01) {
+               if (sym && fabs(*sym->weight_ptr - val) > DBL_EPSILON) {
                        if (!add_dynamic_symbol(ctx->cfg, DEFAULT_METRIC,
                                                                        ucl_object_tostring(jname), val)) {
                                msg_err_session("add symbol failed for %s",