forked from GitHub/gf-core
a simple optimization in cmp_item_prob with great effect on the parser's speed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user