From ee377f4020c25900067e2c11704650b30a0a9e45 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 28 Oct 2010 18:50:55 +0400 Subject: [PATCH] Fixed adding action to metric. --- src/filter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/filter.c b/src/filter.c index 73f45211b..f47dd1a3a 100644 --- a/src/filter.c +++ b/src/filter.c @@ -659,6 +659,7 @@ check_metric_action (double score, double required_score, struct metric *metric) { GList *cur; struct metric_action *action, *selected_action = NULL; + double max_score = 0; if (score >= required_score) { return metric->action; @@ -670,8 +671,9 @@ check_metric_action (double score, double required_score, struct metric *metric) cur = metric->actions; while (cur) { action = cur->data; - if (score >= action->score) { + if (score >= action->score && action->score > max_score) { selected_action = action; + max_score = action->score; } cur = g_list_next (cur); } -- 2.39.5