Skip to content

Commit

Permalink
sstable: populate CompareSuffixes on test4bSuffixComparer
Browse files Browse the repository at this point in the history
Previously, the test4bSuffixComparer test comparer wasn't setting
CompareSuffixes. Update the comparer to simply copy the default comparer
override Split and Name.
  • Loading branch information
jbowens committed Sep 25, 2024
1 parent 3a76074 commit c0fa4a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
13 changes: 13 additions & 0 deletions sstable/suffix_rewriter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,16 @@ func BenchmarkRewriteSST(b *testing.B) {
})
}
}

var test4bSuffixComparer = func() *base.Comparer {
c := new(base.Comparer)
*c = *base.DefaultComparer
c.Split = func(key []byte) int {
if len(key) > 4 {
return len(key) - 4
}
return len(key)
}
c.Name = "comparer-split-4b-suffix"
return c
}()
14 changes: 0 additions & 14 deletions sstable/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1200,17 +1200,3 @@ func runWriterBench(b *testing.B, keys [][]byte, comparer *base.Comparer, format
})
}
}

var test4bSuffixComparer = &base.Comparer{
Compare: base.DefaultComparer.Compare,
Equal: base.DefaultComparer.Equal,
Separator: base.DefaultComparer.Separator,
Successor: base.DefaultComparer.Successor,
Split: func(key []byte) int {
if len(key) > 4 {
return len(key) - 4
}
return len(key)
},
Name: "comparer-split-4b-suffix",
}

0 comments on commit c0fa4a9

Please sign in to comment.