From 6c3cad34816bfaed0da7c6fdbf84f4658f2d38e7 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Mon, 30 May 2022 04:19:21 -0700 Subject: [PATCH] zstd: Use configured block size (#605) Single blocks up to max block size would be created with EncodeAll, if src was smaller. This uses the configured max block size. Block size is max for settings >= default, so no change for these. --- zstd/encoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zstd/encoder.go b/zstd/encoder.go index dcc987a7cb..e6b1d01cf6 100644 --- a/zstd/encoder.go +++ b/zstd/encoder.go @@ -551,7 +551,7 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { } // If we can do everything in one block, prefer that. - if len(src) <= maxCompressedBlockSize { + if len(src) <= e.o.blockSize { enc.Reset(e.o.dict, true) // Slightly faster with no history and everything in one block. if e.o.crc {