From c0bcfaff59f0442c63ca6530fdabfb684edef1d3 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 17 Apr 2020 10:16:36 +0100 Subject: [PATCH] [Minor] Allow to adjust symbols without score change --- src/lua/lua_task.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); -- 2.39.5