remove Assert preventing registration of multiple nested paths

This commit is contained in:
GHXX 2025-04-14 12:09:55 +02:00
parent d152b8f3ae
commit 6ad805841d

View File

@ -84,17 +84,14 @@ internal class PathTree<T> where T : class {
catchAllNext.AddSuccessor(segments[1..], newLeafData);
return;
} else { // must be single wildcard otherwise
Assert(pathWildcardNext == null);
pathWildcardNext = new();
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);