aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--csci1913/Java/project3/project3_strap012.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/csci1913/Java/project3/project3_strap012.java b/csci1913/Java/project3/project3_strap012.java
index 0bed110..ff4ce3a 100644
--- a/csci1913/Java/project3/project3_strap012.java
+++ b/csci1913/Java/project3/project3_strap012.java
@@ -46,8 +46,10 @@ class AnagramTree {
boolean wordExists = false;
while (badNode != null) {
//Traverse word list to find already added entries
- if (badNode.word.equals(word))
+ if (badNode.word.equals(word)) {
wordExists = true;
+ break;
+ }
badNode = badNode.next;
}
if (!wordExists)