a simple optimization in cmp_item_prob with great effect on the parser's speed

This commit is contained in:
kr.angelov
2014-10-23 21:22:22 +00:00
parent 18f8f2e4f4
commit e169f225cf

View File

@@ -564,12 +564,7 @@ cmp_item_prob(GuOrder* self, const void* a, const void* b)
prob_t prob1 = item1->inside_prob + item1->conts->outside_prob;
prob_t prob2 = item2->inside_prob + item2->conts->outside_prob;
if (prob1 < prob2)
return -1;
else if (prob1 > prob2)
return 1;
else
return 0;
return (int) (prob1-prob2);
}
static GuOrder