From ed2aefed9ef9e2e00cebe9d046c5e88651ab846e Mon Sep 17 00:00:00 2001 From: Karl Gaissmaier Date: Sun, 9 Feb 2025 14:09:31 +0100 Subject: [PATCH] fix: overlaps bug, slipped in with patch compression --- overlaps.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overlaps.go b/overlaps.go index 76207ab..f0ce66f 100644 --- a/overlaps.go +++ b/overlaps.go @@ -199,7 +199,7 @@ func (n *node[V]) overlapsSameChildren(o *node[V], depth int) bool { func overlapsTwoChilds[V any](nChild, oChild any, depth int) bool { // 4 possible different combinations for n and o // - // node, node --> overlapsRec, increment depth + // node, node --> overlapsRec // node, leaf --> overlapsPrefixAtDepth // leaf, node --> overlapsPrefixAtDepth // leaf, leaf --> netip.Prefix.Overlaps @@ -209,7 +209,7 @@ func overlapsTwoChilds[V any](nChild, oChild any, depth int) bool { case *node[V]: switch oKind := oChild.(type) { case *node[V]: // node, node - return nKind.overlaps(oKind, depth+1) + return nKind.overlaps(oKind, depth) case *leaf[V]: // node, leaf return nKind.overlapsPrefixAtDepth(oKind.prefix, depth) }