diff --git a/lib/encoding/compress.go b/lib/encoding/compress.go index 6d3a050c3..3761982ee 100644 --- a/lib/encoding/compress.go +++ b/lib/encoding/compress.go @@ -4,14 +4,6 @@ import ( "github.com/valyala/gozstd" ) -// CompressZSTD compresses src, appends the result to dst and returns -// the appended dst. -// -// src must be non-empty. -func CompressZSTD(dst, src []byte) []byte { - return gozstd.CompressLevel(dst, src, 5) -} - // CompressZSTDLevel appends compressed src to dst and returns // the appended dst. // diff --git a/lib/encoding/compress_test.go b/lib/encoding/compress_test.go index 48224ea72..f959f1be3 100644 --- a/lib/encoding/compress_test.go +++ b/lib/encoding/compress_test.go @@ -17,7 +17,7 @@ func TestCompressDecompressZSTD(t *testing.T) { } func testCompressDecompressZSTD(t *testing.T, b []byte) { - bc := CompressZSTD(nil, b) + bc := CompressZSTDLevel(nil, b, 5) bNew, err := DecompressZSTD(nil, bc) if err != nil { t.Fatalf("unexpected error when decompressing b=%x from bc=%x: %s", b, bc, err) @@ -27,7 +27,7 @@ func testCompressDecompressZSTD(t *testing.T, b []byte) { } prefix := []byte{1, 2, 33} - bcNew := CompressZSTD(prefix, b) + bcNew := CompressZSTDLevel(prefix, b, 5) if string(bcNew[:len(prefix)]) != string(prefix) { t.Fatalf("invalid prefix for b=%x; got\n%x; expecting\n%x", b, bcNew[:len(prefix)], prefix) }