mirror of
https://github.com/facebook/zstd.git
synced 2025-10-10 00:03:36 -04:00
Going back to original flow but removing else return
This commit is contained in:
parent
80586f5e80
commit
8f0c2d04c8
@ -2480,13 +2480,11 @@ static size_t ZSTD_compressBlock_targetCBlockSize(ZSTD_CCtx* zc,
|
|||||||
* enough for SuperBlock compression.
|
* enough for SuperBlock compression.
|
||||||
* In such case, fall back to normal compression. This is possible because
|
* In such case, fall back to normal compression. This is possible because
|
||||||
* targetCBlockSize is best effort not a guarantee. */
|
* targetCBlockSize is best effort not a guarantee. */
|
||||||
if (cSize != ERROR(dstSize_tooSmall) && (dstCapacity - cSize) >= 4)
|
if (cSize == ERROR(dstSize_tooSmall) || (dstCapacity - cSize) < 4) {
|
||||||
/* We check (dstCapacity - cSize) >= 4 above because we have to make sure
|
/* We check (dstCapacity - cSize) >= 4 above because we have to make sure
|
||||||
* to leave enough room for the checksum that will eventually get added in
|
* to leave enough room for the checksum that will eventually get added in
|
||||||
* the epilogue. Otherwise, we're just going to throw the dstSize_tooSmall
|
* the epilogue. Otherwise, we're just going to throw the dstSize_tooSmall
|
||||||
* error there instead of here */
|
* error there instead of here */
|
||||||
return cSize;
|
|
||||||
else {
|
|
||||||
BYTE* const ostart = (BYTE*)dst;
|
BYTE* const ostart = (BYTE*)dst;
|
||||||
/* If ZSTD_noCompressSuperBlock fails with dstSize_tooSmall,
|
/* If ZSTD_noCompressSuperBlock fails with dstSize_tooSmall,
|
||||||
* compress normally.
|
* compress normally.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user