Skip to content

Fix memoization for rules_get_def() #4

Description

@antrikshdhand

Currently, despite rules_get_def() inserting rules into the rule hash table at the end:

// Memoize.
if (sum_rule != NULL)
    insert_rule(&rule_strs, rule_copy, l_str, sum_rule);

the function get_rule() doesn't actually work. It does not correctly identify whether one RuleNode is equal to another, and therefore never returns a value from the hash table.

Fixing this will improve the performance of the function.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions