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) }