From a6555ea0d6d5b2f388b49249338065c804722553 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Sun, 29 May 2022 14:04:05 +0200 Subject: [PATCH] zstd: Use configured block size 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 {