Commit 91d547c9 authored by Manuel  Segimon's avatar Manuel Segimon
Browse files

Fix issue with empty word in TrieNode.java

parent b420daf8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@ public class TrieNode implements Serializable, Cloneable {
        TrieNode current = this;
        TrieNode past = this; // Store the previous node
        for (String word : phrase) {
            if (word.length() == 0) {
                continue;
            }
            past = current;
            current = current.children.computeIfAbsent(word, c -> new TrieNode());
        }