Skip to content

Commit

Permalink
Add a feedback version of the hash function
Browse files Browse the repository at this point in the history
  • Loading branch information
linas committed Apr 26, 2024
1 parent c52c9a6 commit 506fc7f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions link-grammar/connectors.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,11 @@ static inline connector_hash_t connector_list_hash(const Connector *c)
connector_hash_t accum = connector_hash(c);

for (c = c->next; c != NULL; c = c->next)
#ifdef FEEDBACK_HASH
accum = (19 * accum) + (accum >> 24) + connector_hash(c);
#else
accum = (19 * accum) + connector_hash(c);
#endif

return accum;
}
Expand Down

0 comments on commit 506fc7f

Please sign in to comment.