From: Vsevolod Stakhov Date: Fri, 17 Apr 2020 09:16:36 +0000 (+0100) Subject: [Minor] Allow to adjust symbols without score change X-Git-Tag: 2.6~520 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c0bcfaff59f0442c63ca6530fdabfb684edef1d3;p=rspamd.git [Minor] Allow to adjust symbols without score change --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 4f92bdb06..3ad1aa3db 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -2003,9 +2003,11 @@ lua_task_adjust_result (lua_State * L) } if (s) { - metric_res->score -= s->score; - s->score = weight; - metric_res->score += s->score; + if (!isnan (weight)) { + metric_res->score -= s->score; + s->score = weight; + metric_res->score += s->score; + } } else { return luaL_error (L, "symbol not found: %s", symbol_name);