From 19b6643e5ca16aa63b8cf33d3c574b498e48a09c Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 24 May 2019 12:32:23 +0300 Subject: [PATCH] lib/encoding: substitute CompressZSTD with CompressZSTDLevel --- lib/encoding/compress.go | 8 -------- lib/encoding/compress_test.go | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/encoding/compress.go b/lib/encoding/compress.go index 6d3a050c3d..3761982eea 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 48224ea725..f959f1be3b 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) }