mirror of
https://github.com/facebook/zstd.git
synced 2025-11-30 00:03:21 -05:00
Save one byte on the frame epilogue
This commit is contained in:
parent
ef59cc39cd
commit
55ff3e4e17
@ -5192,8 +5192,9 @@ static size_t ZSTD_writeEpilogue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity)
|
|||||||
if (cctx->stage != ZSTDcs_ending) {
|
if (cctx->stage != ZSTDcs_ending) {
|
||||||
/* write one last empty block, make it the "last" block */
|
/* write one last empty block, make it the "last" block */
|
||||||
U32 const cBlockHeader24 = 1 /* last block */ + (((U32)bt_raw)<<1) + 0;
|
U32 const cBlockHeader24 = 1 /* last block */ + (((U32)bt_raw)<<1) + 0;
|
||||||
RETURN_ERROR_IF(dstCapacity<4, dstSize_tooSmall, "no room for epilogue");
|
ZSTD_STATIC_ASSERT(ZSTD_BLOCKHEADERSIZE == 3);
|
||||||
MEM_writeLE32(op, cBlockHeader24);
|
RETURN_ERROR_IF(dstCapacity<3, dstSize_tooSmall, "no room for epilogue");
|
||||||
|
MEM_writeLE24(op, cBlockHeader24);
|
||||||
op += ZSTD_blockHeaderSize;
|
op += ZSTD_blockHeaderSize;
|
||||||
dstCapacity -= ZSTD_blockHeaderSize;
|
dstCapacity -= ZSTD_blockHeaderSize;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user