Evaluation Order为0时,策略执行顺序最靠后。

This commit is contained in:
zhengchao
2020-02-28 18:00:44 +08:00
parent b6fd57ffb9
commit af6f23fd13
3 changed files with 38 additions and 3 deletions

View File

@@ -114,7 +114,7 @@ static void compile_sort_para_set(struct compile_sort_para* para, const struct M
}
static int compile_sort_para_compare(const struct compile_sort_para* a, const struct compile_sort_para* b)
{
//If both of compile rule's execute sequences are specified, compile rule with lower execute sequence is priority.
//If both of compile rule's evaluation order are specified, compile rule with small evaluation order is priority.
if(a->evaluation_order!=0 && b->evaluation_order!=0)
{
if(a->evaluation_order - b->evaluation_order <0)
@@ -126,6 +126,11 @@ static int compile_sort_para_compare(const struct compile_sort_para* a, const st
return 1;
}
}
//If one of compile rule's evaluation order is zero, compile rule with big evaluation order is priority.
else if(a->evaluation_order + b->evaluation_order!= 0)
{
return (a->evaluation_order - b->evaluation_order >0) ? -1 : 1;
}
//If compile rule's execute sequences are not specified or equal.
if(a->group_cnt!=b->group_cnt)
{