@@ -31,23 +31,23 @@ type _NODE_TYPE[V any] struct {
3131 Children struct { bitset.BitSet256 }
3232}
3333
34- func (n * _NODE_TYPE [V ]) IsEmpty () (_ bool ) { return }
35- func (n * _NODE_TYPE [V ]) PrefixCount () (_ int ) { return }
36- func (n * _NODE_TYPE [V ]) ChildCount () (_ int ) { return }
37- func (n * _NODE_TYPE [V ]) MustGetPrefix (uint8 ) (_ V ) { return }
38- func (n * _NODE_TYPE [V ]) MustGetChild (uint8 ) (_ any ) { return }
39- func (n * _NODE_TYPE [V ]) InsertPrefix (uint8 , V ) (_ bool ) { return }
40- func (n * _NODE_TYPE [V ]) DeletePrefix (uint8 ) (_ bool ) { return }
41- func (n * _NODE_TYPE [V ]) GetChild (uint8 ) (_ any , _ bool ) { return }
42- func (n * _NODE_TYPE [V ]) GetPrefix (uint8 ) (_ V , _ bool ) { return }
43- func (n * _NODE_TYPE [V ]) InsertChild (uint8 , any ) (_ bool ) { return }
44- func (n * _NODE_TYPE [V ]) DeleteChild (uint8 ) (_ bool ) { return }
45- func (n * _NODE_TYPE [V ]) CloneRec (CloneFunc [V ]) (_ * _NODE_TYPE [V ]) { return }
46- func (n * _NODE_TYPE [V ]) CloneFlat (CloneFunc [V ]) (_ * _NODE_TYPE [V ]) { return }
47- func (n * _NODE_TYPE [V ]) AllIndices () (seq2 iter.Seq2 [uint8 , V ]) { return }
48- func (n * _NODE_TYPE [V ]) AllChildren () (seq2 iter.Seq2 [uint8 , any ]) { return }
49- func (n * _NODE_TYPE [V ]) Contains (uint8 ) (_ bool ) { return }
50- func (n * _NODE_TYPE [V ]) LookupIdx (uint8 ) (_ uint8 , _ V , _ bool ) { return }
34+ func (n * _NODE_TYPE [V ]) IsEmpty () (_ bool ) { return }
35+ func (n * _NODE_TYPE [V ]) PrefixCount () (_ int ) { return }
36+ func (n * _NODE_TYPE [V ]) ChildCount () (_ int ) { return }
37+ func (n * _NODE_TYPE [V ]) MustGetPrefix (uint8 ) (_ V ) { return }
38+ func (n * _NODE_TYPE [V ]) MustGetChild (uint8 ) (_ any ) { return }
39+ func (n * _NODE_TYPE [V ]) InsertPrefix (uint8 , V ) (_ bool ) { return }
40+ func (n * _NODE_TYPE [V ]) DeletePrefix (uint8 ) (_ bool ) { return }
41+ func (n * _NODE_TYPE [V ]) GetChild (uint8 ) (_ any , _ bool ) { return }
42+ func (n * _NODE_TYPE [V ]) GetPrefix (uint8 ) (_ V , _ bool ) { return }
43+ func (n * _NODE_TYPE [V ]) InsertChild (uint8 , any ) (_ bool ) { return }
44+ func (n * _NODE_TYPE [V ]) DeleteChild (uint8 ) (_ bool ) { return }
45+ func (n * _NODE_TYPE [V ]) CloneRec (value. CloneFunc [V ]) (_ * _NODE_TYPE [V ]) { return }
46+ func (n * _NODE_TYPE [V ]) CloneFlat (value. CloneFunc [V ]) (_ * _NODE_TYPE [V ]) { return }
47+ func (n * _NODE_TYPE [V ]) AllIndices () (seq2 iter.Seq2 [uint8 , V ]) { return }
48+ func (n * _NODE_TYPE [V ]) AllChildren () (seq2 iter.Seq2 [uint8 , any ]) { return }
49+ func (n * _NODE_TYPE [V ]) Contains (uint8 ) (_ bool ) { return }
50+ func (n * _NODE_TYPE [V ]) LookupIdx (uint8 ) (_ uint8 , _ V , _ bool ) { return }
5151
5252// ### GENERATE DELETE END ###
5353
@@ -145,7 +145,7 @@ func (n *_NODE_TYPE[V]) Insert(pfx netip.Prefix, val V, depth int) (exists bool)
145145// InsertPersist is similar to insert but the receiver isn't modified.
146146// Assumes the caller has pre-cloned the root (COW). It clones the
147147// internal nodes along the descent path before mutating them.
148- func (n * _NODE_TYPE [V ]) InsertPersist (cloneFn CloneFunc [V ], pfx netip.Prefix , val V , depth int ) (exists bool ) {
148+ func (n * _NODE_TYPE [V ]) InsertPersist (cloneFn value. CloneFunc [V ], pfx netip.Prefix , val V , depth int ) (exists bool ) {
149149 ip := pfx .Addr () // the pfx must be in canonical form
150150 octets := ip .AsSlice ()
151151 lastOctetPlusOne , lastBits := LastOctetPlusOneAndLastBits (pfx )
@@ -396,7 +396,7 @@ func (n *_NODE_TYPE[V]) Delete(pfx netip.Prefix) (exists bool) {
396396// DeletePersist is similar to delete but does not mutate the original trie.
397397// Assumes the caller has pre-cloned the root (COW). It clones the
398398// internal nodes along the descent path before mutating them.
399- func (n * _NODE_TYPE [V ]) DeletePersist (cloneFn CloneFunc [V ], pfx netip.Prefix ) (exists bool ) {
399+ func (n * _NODE_TYPE [V ]) DeletePersist (cloneFn value. CloneFunc [V ], pfx netip.Prefix ) (exists bool ) {
400400 ip := pfx .Addr () // the pfx must be in canonical form
401401 is4 := ip .Is4 ()
402402 octets := ip .AsSlice ()
@@ -745,7 +745,7 @@ func (n *_NODE_TYPE[V]) EqualRec(o *_NODE_TYPE[V]) bool {
745745
746746 for idx , nVal := range n .AllIndices () {
747747 oVal := o .MustGetPrefix (idx ) // mustGet is ok, bitsets are equal
748- if ! Equal (nVal , oVal ) {
748+ if ! value . Equal (nVal , oVal ) {
749749 return false
750750 }
751751 }
@@ -779,7 +779,7 @@ func (n *_NODE_TYPE[V]) EqualRec(o *_NODE_TYPE[V]) bool {
779779 }
780780
781781 // compare values
782- if ! Equal (nKid .Value , oKid .Value ) {
782+ if ! value . Equal (nKid .Value , oKid .Value ) {
783783 return false
784784 }
785785
@@ -791,7 +791,7 @@ func (n *_NODE_TYPE[V]) EqualRec(o *_NODE_TYPE[V]) bool {
791791 }
792792
793793 // compare values
794- if ! Equal (nKid .Value , oKid .Value ) {
794+ if ! value . Equal (nKid .Value , oKid .Value ) {
795795 return false
796796 }
797797
@@ -1257,9 +1257,9 @@ func (n *_NODE_TYPE[V]) DirectItemsRec(parentIdx uint8, path StridePath, depth i
12571257// The merge operation is destructive on the receiver n, but leaves the source node o unchanged.
12581258//
12591259// Returns the number of duplicate prefixes that were overwritten during merging.
1260- func (n * _NODE_TYPE [V ]) UnionRec (cloneFn CloneFunc [V ], o * _NODE_TYPE [V ], depth int ) (duplicates int ) {
1260+ func (n * _NODE_TYPE [V ]) UnionRec (cloneFn value. CloneFunc [V ], o * _NODE_TYPE [V ], depth int ) (duplicates int ) {
12611261 if cloneFn == nil {
1262- cloneFn = copyVal
1262+ cloneFn = value . CopyVal
12631263 }
12641264
12651265 buf := [256 ]uint8 {}
@@ -1290,9 +1290,9 @@ func (n *_NODE_TYPE[V]) UnionRec(cloneFn CloneFunc[V], o *_NODE_TYPE[V], depth i
12901290}
12911291
12921292// UnionRecPersist is similar to unionRec but performs an immutable union of nodes.
1293- func (n * _NODE_TYPE [V ]) UnionRecPersist (cloneFn CloneFunc [V ], o * _NODE_TYPE [V ], depth int ) (duplicates int ) {
1293+ func (n * _NODE_TYPE [V ]) UnionRecPersist (cloneFn value. CloneFunc [V ], o * _NODE_TYPE [V ], depth int ) (duplicates int ) {
12941294 if cloneFn == nil {
1295- cloneFn = copyVal
1295+ cloneFn = value . CopyVal
12961296 }
12971297
12981298 buf := [256 ]uint8 {}
@@ -1341,7 +1341,7 @@ func (n *_NODE_TYPE[V]) UnionRecPersist(cloneFn CloneFunc[V], o *_NODE_TYPE[V],
13411341// fringe, node <-- insert new node, push this fringe down, union rec-descent
13421342// fringe, leaf <-- insert new node, push this fringe down, insert other leaf at depth+1
13431343// fringe, fringe <-- just overwrite value
1344- func (n * _NODE_TYPE [V ]) handleMatrix (cloneFn CloneFunc [V ], thisExists bool , thisChild , otherChild any , addr uint8 , depth int ) int {
1344+ func (n * _NODE_TYPE [V ]) handleMatrix (cloneFn value. CloneFunc [V ], thisExists bool , thisChild , otherChild any , addr uint8 , depth int ) int {
13451345 // Do ALL type assertions upfront - reduces line noise
13461346 var (
13471347 thisNode , thisIsNode = thisChild .(* _NODE_TYPE [V ])
@@ -1458,7 +1458,7 @@ func (n *_NODE_TYPE[V]) handleMatrix(cloneFn CloneFunc[V], thisExists bool, this
14581458// fringe, node <-- insert new node, push this fringe down, union rec-descent
14591459// fringe, leaf <-- insert new node, push this fringe down, insert other leaf at depth+1
14601460// fringe, fringe <-- just overwrite value
1461- func (n * _NODE_TYPE [V ]) handleMatrixPersist (cloneFn CloneFunc [V ], thisExists bool , thisChild , otherChild any , addr uint8 , depth int ) int {
1461+ func (n * _NODE_TYPE [V ]) handleMatrixPersist (cloneFn value. CloneFunc [V ], thisExists bool , thisChild , otherChild any , addr uint8 , depth int ) int {
14621462 // Do ALL type assertions upfront - reduces line noise
14631463 var (
14641464 thisNode , thisIsNode = thisChild .(* _NODE_TYPE [V ])
0 commit comments