@@ -462,7 +462,8 @@ func TestBTreeCloneConcurrentOperations(t *testing.T) {
462
462
t .Logf ("Starting equality checks on %d trees" , len (trees ))
463
463
want := rang (0 , cloneTestSize - 1 )
464
464
for i , tree := range trees {
465
- if got := all (tree ); ! reflect .DeepEqual (strReprs (got ), strReprs (want )) {
465
+ got := slices .Collect (tree .All ())
466
+ if ! reflect .DeepEqual (strReprs (got ), strReprs (want )) {
466
467
t .Errorf ("tree %v mismatch" , i )
467
468
}
468
469
}
@@ -489,7 +490,8 @@ func TestBTreeCloneConcurrentOperations(t *testing.T) {
489
490
} else {
490
491
wantpart = want
491
492
}
492
- if got := all (tree ); ! reflect .DeepEqual (strReprs (got ), strReprs (wantpart )) {
493
+ got := slices .Collect (tree .All ())
494
+ if ! reflect .DeepEqual (strReprs (got ), strReprs (wantpart )) {
493
495
t .Errorf ("tree %v mismatch, want %#v got %#v" , i , strReprs (wantpart ), strReprs (got ))
494
496
}
495
497
}
@@ -666,17 +668,6 @@ func strReprs(items []*TableMetadata) []string {
666
668
return s
667
669
}
668
670
669
- // all extracts all items from a tree in order as a slice.
670
- func all (tr * btree [* TableMetadata ]) (out []* TableMetadata ) {
671
- it := tableMetadataIter (tr )
672
- it .first ()
673
- for it .valid () {
674
- out = append (out , it .cur ())
675
- it .next ()
676
- }
677
- return out
678
- }
679
-
680
671
func forBenchmarkSizes (b * testing.B , f func (b * testing.B , count int )) {
681
672
for _ , count := range []int {16 , 128 , 1024 , 8192 , 65536 } {
682
673
b .Run (fmt .Sprintf ("count=%d" , count ), func (b * testing.B ) {
0 commit comments