From 3e56b95c02695ee4c62a180340a2967c72ed208e Mon Sep 17 00:00:00 2001 From: asofold Date: Mon, 3 Sep 2012 02:55:47 +0200 Subject: [PATCH] Corrections for LookupTree. --- .../nocheatplus/checks/chat/analysis/ds/LookupTree.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fr/neatmonster/nocheatplus/checks/chat/analysis/ds/LookupTree.java b/src/fr/neatmonster/nocheatplus/checks/chat/analysis/ds/LookupTree.java index e0d63b4b..d571c265 100644 --- a/src/fr/neatmonster/nocheatplus/checks/chat/analysis/ds/LookupTree.java +++ b/src/fr/neatmonster/nocheatplus/checks/chat/analysis/ds/LookupTree.java @@ -26,7 +26,7 @@ public class LookupTree>{ public Node getChild(final K key, final NodeFactory> factory){ if (children == null){ - if (factory != null) children = new HashMap>(); + if (factory != null) children = new HashMap>(3); else return null; } Node node = children.get(key); @@ -108,9 +108,12 @@ public class LookupTree>{ depth ++; } } - if (create || insertion.isEnd && depth == keys.size()){ + if (create){ + node = current; + current.isEnd = true; + } + else if (depth == keys.size()){ node = current; - if (insertion != current) current.isEnd = true; } return new LookupEntry(node, insertion, depth); }