summaryrefslogtreecommitdiff
path: root/wk5
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-29 02:42:14 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-29 02:42:14 +0000
commiteff41ddbeee88c65872923423276042dc5604529 (patch)
treeba7d611a31b5ce77831d4f50c5804bb2581fe3c8 /wk5
parent7a7e45f833274377d26a22b89e62a2ce7bbc1b6e (diff)
Sun, Apr 28, 2024, 7:42 PM -07:00
Diffstat (limited to 'wk5')
-rw-r--r--wk5/pset/speller/dictionary.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index f479021..b23275a 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -27,13 +27,14 @@ int siz = 0;
bool check(const char *word)
{
// hash word to find bucket
- node *current = table[hash(word)];
+ int val = hash(word);
+ node *current = table[val];
// check all nodes in the bucket
while (current != NULL)
{
// check if this is the word
- if (current->word == word)
+ if (current->word word)
{
return true;
}