remove Assert preventing registration of multiple nested paths
This commit is contained in:
parent
d152b8f3ae
commit
6ad805841d
|
|
@ -83,18 +83,15 @@ internal class PathTree<T> where T : class {
|
|||
catchAllNext = new();
|
||||
catchAllNext.AddSuccessor(segments[1..], newLeafData);
|
||||
return;
|
||||
} else { // must be single wildcard otherwise
|
||||
Assert(pathWildcardNext == null);
|
||||
pathWildcardNext = new();
|
||||
} else { // must be single wildcard otherwise
|
||||
pathWildcardNext ??= new();
|
||||
pathWildcardNext.AddSuccessor(segments[1..], newLeafData);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise we want to add a new constant path successor
|
||||
if (next == null) {
|
||||
next = new();
|
||||
}
|
||||
next ??= new();
|
||||
|
||||
if (next.TryGetValue(seg, out var existingNode)) {
|
||||
existingNode.AddSuccessor(segments[1..], newLeafData);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user