summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 23:14:07 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 23:14:07 +0000
commit5fa305570723eb2e14f4b52fadd8d13960af3b43 (patch)
treeb76672f72816f6d86772d912849cb0090958054c
parentf3a427355582b16f56275f71749d9ee92c15b6dd (diff)
Sun, Apr 28, 2024, 4:14 PM -07:00
-rw-r--r--wk5/pset/speller/dictionary.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index c158acd..a4e65fe 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -25,9 +25,9 @@ int size = 0;
bool check(const char *word)
{
// hash word to find bucket
- int head = hash(word);
- node *current = table(head);
+ node *current = table(hash(word));
+ // check all nodes in the bucket
while (current != NULL)
{
// check if this is the word
@@ -35,7 +35,6 @@ bool check(const char *word)
{
return true;
}
-
// move on to next node
current = current->next;
}