mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
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 prob1 = item1->inside_prob + item1->conts->outside_prob;
|
||||||
prob_t prob2 = item2->inside_prob + item2->conts->outside_prob;
|
prob_t prob2 = item2->inside_prob + item2->conts->outside_prob;
|
||||||
|
|
||||||
if (prob1 < prob2)
|
return (int) (prob1-prob2);
|
||||||
return -1;
|
|
||||||
else if (prob1 > prob2)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GuOrder
|
static GuOrder
|
||||||
|
|||||||
Reference in New Issue
Block a user