summaryrefslogtreecommitdiff
path: root/wk5/pset/speller
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-29 02:46:55 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-29 02:46:55 +0000
commitac7b62ee5230c957df4110e6afe45676e0ede6a3 (patch)
tree56bbdbbe6dfaad2cf3fd0ae12be98534b7b84077 /wk5/pset/speller
parent0b1aa11c8f47ee4ce69ce988b8dd51d5859cce99 (diff)
Sun, Apr 28, 2024, 7:46 PM -07:00
Diffstat (limited to 'wk5/pset/speller')
-rw-r--r--wk5/pset/speller/dictionary.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index 1bfc12b..5e5cff1 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -96,14 +96,14 @@ bool load(const char *dictionary)
// hash the word to find the bucket it goes in
int val = hash(ptr->word);
// put new node at begining of bucket
- if (table[val]->next != 0)
+ if (table[val] != NULL)
{
- ptr->next = table[val]->next;
- table[val]->next = ptr;
+ ptr->next = table[val];
+ table[val] = ptr;
}
else
{
- table[val]->next = ptr;
+ table[val] = ptr;
}
}