Skip to content

Commit

Permalink
Check desc strings only if the descs differ.
Browse files Browse the repository at this point in the history
If the descs are the same, then we know the strings cannot differ.
Ths resolves
opencog#1396 (comment)
  • Loading branch information
linas committed Feb 7, 2023
1 parent e746230 commit 11cd5c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions link-grammar/parse/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,14 @@ static int linkage_equiv_p(Linkage lpv, Linkage lnx)
Link * plk = &lpv->link_array[li];
Link * nlk = &lnx->link_array[li];

if (plk->lc != nlk->lc)
if (plk->lc != nlk->lc && plk->lc->desc != nlk->lc->desc)
{
int diff = strcmp(plk->lc->desc->string, nlk->lc->desc->string);
if (diff) return diff;
int md = plk->lc->multi - nlk->lc->multi;
if (md) return md;
}
if (plk->rc != nlk->rc)
if (plk->rc != nlk->rc && plk->rc->desc != nlk->rc->desc)
{
int diff = strcmp(plk->rc->desc->string, nlk->rc->desc->string);
if (diff) return diff;
Expand Down

0 comments on commit 11cd5c5

Please sign in to comment.