From 803f62c6348962cb9283c59d5ddb53bbaebe1569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=80=9D=E6=95=8F?= Date: Thu, 1 Sep 2022 16:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0TAP=E6=B5=8B=E8=AF=95(TODO=20=E8=A7=A3?= =?UTF-8?q?=E6=9E=90arp)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils.go b/utils.go index 15c6129..d8d8d5d 100644 --- a/utils.go +++ b/utils.go @@ -12,6 +12,7 @@ var encoder, _ = zstd.NewWriter(nil) // Compress a buffer. // If you have a destination buffer, the allocation in the call can also be eliminated. func Compress(src []byte) []byte { + return src return encoder.EncodeAll(src, make([]byte, 0, len(src))) } @@ -22,6 +23,7 @@ var decoder, _ = zstd.NewReader(nil, zstd.WithDecoderConcurrency(0)) // Decompress a buffer. We don't supply a destination buffer, // so it will be allocated by the decoder. func Decompress(src []byte) ([]byte, error) { + return src, nil return decoder.DecodeAll(src, nil) }