Skip to content

Commit

Permalink
tracon-set.c: Use connector_list_hash()
Browse files Browse the repository at this point in the history
  • Loading branch information
ampli committed Apr 15, 2024
1 parent c1553cb commit 79a694a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
13 changes: 2 additions & 11 deletions link-grammar/tracon-set.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,9 @@

static tid_hash_t hash_connectors(const Connector *c, unsigned int shallow)
{
tid_hash_t accum = shallow && c->shallow;
tid_hash_t accum = (shallow && c->shallow) ? 1000003 : 0;

for (; c != NULL; c = c->next)
{
accum = (19 * accum) +
c->desc->uc_num +
(((unsigned int)c->multi)<<19) +
((((unsigned int)c->desc->lc_mask) & 1)<<20) +
(((unsigned int)c->desc->lc_letters)<<22);
}

return accum;
return accum + connector_list_hash(c);
}

#if 0
Expand Down
3 changes: 2 additions & 1 deletion link-grammar/tracon-set.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <stdint.h>

#include "api-types.h"
#include "connectors.h"
#include "const-prime.h"
#include "error.h"

Expand All @@ -27,7 +28,7 @@
#endif
#endif

typedef size_t tid_hash_t;
typedef connector_hash_t tid_hash_t;
typedef struct
{
Connector *clist;
Expand Down

0 comments on commit 79a694a

Please sign in to comment.