Skip to content
Permalink
Browse files

Optimize StrTrie.Add loop

  • Loading branch information...
bobbymcr committed Apr 5, 2019
1 parent c6f4bf5 commit 8b207753e0f5ff73484d25c593cef115e9488687
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/Words.Core/StrTrie.cs
@@ -93,10 +93,12 @@ public void Add(Str value)
while (value.Length > 1)
{
value = value.Chop();
if (!this.nodes.ContainsKey(value))
if (this.nodes.ContainsKey(value))
{
this.nodes.Add(value, false);
return;
}

this.nodes.Add(value, false);
}
}

0 comments on commit 8b20775

Please sign in to comment.
You can’t perform that action at this time.