mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-02 08:40:01 +01:00
node is a newly added node, if create == true.
This commit is contained in:
parent
ae4d4bad7d
commit
0915725410
@ -89,7 +89,7 @@ public class LookupTree<K, N extends Node<K>>{
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public LookupEntry<K, N> lookup(final List<K> keys, final boolean create){
|
public LookupEntry<K, N> lookup(final List<K> keys, final boolean create){
|
||||||
N insertion = root;
|
N insertion = root;
|
||||||
N leaf = null;
|
N node = null;
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
N current = root;
|
N current = root;
|
||||||
final NodeFactory<K, N> factory = (NodeFactory<K, N>) (create ? this.factory : null);
|
final NodeFactory<K, N> factory = (NodeFactory<K, N>) (create ? this.factory : null);
|
||||||
@ -109,10 +109,10 @@ public class LookupTree<K, N extends Node<K>>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (create || insertion.isEnd && depth == keys.size()){
|
if (create || insertion.isEnd && depth == keys.size()){
|
||||||
leaf = current;
|
node = current;
|
||||||
if (insertion != current) current.isEnd = true;
|
if (insertion != current) current.isEnd = true;
|
||||||
}
|
}
|
||||||
return new LookupEntry<K, N>(leaf, insertion, depth);
|
return new LookupEntry<K, N>(node, insertion, depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
|
Loading…
Reference in New Issue
Block a user