Skip to content

Commit

Permalink
fix:error default compress level
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-Cheng committed Feb 11, 2024
1 parent b742063 commit 3754ffc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion zstd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/klauspost/compress/zstd"
"github.com/valyala/bytebufferpool"

"github.com/valyala/fasthttp/stackless"
)

Expand Down Expand Up @@ -149,7 +150,7 @@ func nonblockingWriteZstd(ctxv any) {

// AppendZstdBytes appends zstd src to dst and returns the resulting dst.
func AppendZstdBytes(dst, src []byte) []byte {
return AppendZstdBytesLevel(dst, src, CompressBrotliDefaultCompression)
return AppendZstdBytesLevel(dst, src, CompressZstdDefault)
}

// WriteUnzstd writes unzstd p to w and returns the number of uncompressed
Expand Down
2 changes: 1 addition & 1 deletion zstd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func testZstdBytesSingleCase(s string) error {
if !bytes.Equal(ZstdpedS[:len(prefix)], prefix) {
return fmt.Errorf("unexpected prefix when compressing %q: %q. Expecting %q", s, ZstdpedS[:len(prefix)], prefix)
}

unZstdedS, err := AppendUnzstdBytes(prefix, ZstdpedS[len(prefix):])
if err != nil {
return fmt.Errorf("unexpected error when uncompressing %q: %w", s, err)
Expand Down

0 comments on commit 3754ffc

Please sign in to comment.