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