Skip to content

Commit

Permalink
fix: overlaps bug, slipped in with patch compression
Browse files Browse the repository at this point in the history
  • Loading branch information
gaissmai committed Feb 9, 2025
1 parent 57b7d93 commit ed2aefe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions overlaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down

0 comments on commit ed2aefe

Please sign in to comment.