]> git.ipfire.org Git - thirdparty/zstd.git/commit
nextToUpdate3 does not need to be maintained outside of zstd_opt.c
authorYann Collet <cyan@fb.com>
Tue, 28 May 2019 22:26:52 +0000 (15:26 -0700)
committerYann Collet <cyan@fb.com>
Tue, 28 May 2019 22:26:52 +0000 (15:26 -0700)
commit327cf6fac115fab8ff32adaad2a2727286abf2a4
treeb65c16b0c9a10669c878aa700ae420258f7b9530
parent6453f8158f2a10846490266d5fa07e9d40c8307a
nextToUpdate3 does not need to be maintained outside of zstd_opt.c

It's re-synchronized with nextToUpdate at beginning of each block.
It only needs to be tracked from within zstd_opt block parser.

Made the logic clear, so that no code tried to maintain this variable.

An even better solution would be to make nextToUpdate3
an internal variable of ZSTD_compressBlock_opt_generic().
That would make it possible to remove it from ZSTD_matchState_t,
thus restricting its visibility to only where it's actually useful.

This would require deeper changes though,
since the matchState is the natural structure to transport parameters into and inside the parser.
lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h
lib/compress/zstd_lazy.c
lib/compress/zstd_opt.c