From 5fa305570723eb2e14f4b52fadd8d13960af3b43 Mon Sep 17 00:00:00 2001
From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com>
Date: Sun, 28 Apr 2024 23:14:07 +0000
Subject: Sun, Apr 28, 2024, 4:14 PM -07:00

---
 wk5/pset/speller/dictionary.c | 5 ++---
 1 file 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;
     }
-- 
cgit v1.2.3