Remove dead decompress helpers and fix two copy-paste slips - #154
Open
sribalakumar wants to merge 1 commit into
Open
Remove dead decompress helpers and fix two copy-paste slips#154sribalakumar wants to merge 1 commit into
sribalakumar wants to merge 1 commit into
Conversation
No behaviour change. - Remove the unused one-shot decompress path: zstd_decompress, its decompress_wrapper, and the decompress_params struct in common.h, plus decompress_buffered in zstdruby.c. Nothing calls them since decompress was rewritten around decode_one_frame/ZSTD_decompressStream; the streaming wrapper (stream_decompress_wrapper) is unaffected. - rb_ddict_alloc declared its pointer as ZSTD_CDict* though it wraps a DDict; correct it to ZSTD_DDict* (it is NULL here, so the wrong type name was cosmetic). - set_decompress_params raised "ZSTD_CCtx_loadDictionary failed" on a DDict load error; correct it to ZSTD_DCtx_loadDictionary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is pure cleanup with no behaviour change. It's deliberately kept as a separate PR from the GVL fix so each can be reviewed independently on its own merits.
Changes
Remove dead code that nothing calls any more: the one-shot decompress path
zstd_decompress, itsdecompress_wrapperfunction, and thedecompress_paramsstruct — all incommon.h— plusdecompress_bufferedinzstdruby.c. These are leftovers from whenZstd.decompresswas rewritten to usedecode_one_frame/ZSTD_decompressStream. The streaming wrapperstream_decompress_wrapperis a different function that is still in use and is left untouched.Fix a wrong pointer type in
rb_ddict_alloc: a local was declaredZSTD_CDict*(the compress-dictionary type) while it actually holds a decompress dictionary. Corrected toZSTD_DDict*. The variable isNULLat that point, so this was a cosmetic type-naming issue with no functional effect.Fix a wrong error message in
set_decompress_params: the error raised on a DDict-load failure read"ZSTD_CCtx_loadDictionary failed"(the compress-context function) when it should reference the decompress-context function. Corrected to"ZSTD_DCtx_loadDictionary failed".Verification
The full test suite passes: 72 examples, 0 failures.