diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-02-01 08:32:05 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-02-01 08:32:05 +0200 |
commit | 7dd48578a3853e0cfab9f1830bc30927173ec4bc (patch) | |
tree | bad5718dde85056e2414ed22afa1f5b72f257ab7 /src/liblzma | |
parent | Updated THANKS. (diff) | |
download | xz-7dd48578a3853e0cfab9f1830bc30927173ec4bc.tar.xz |
Avoid unneeded function call in raw_common.c.
Diffstat (limited to '')
-rw-r--r-- | src/liblzma/common/raw_common.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/liblzma/common/raw_common.c b/src/liblzma/common/raw_common.c index 394903bc..d45bf4de 100644 --- a/src/liblzma/common/raw_common.c +++ b/src/liblzma/common/raw_common.c @@ -28,7 +28,7 @@ /// \return true if error occurred, false on success. /// static bool -prepare(lzma_vli *id, lzma_vli *uncompressed_size, bool implicit) +prepare(lzma_vli *id, lzma_vli *uncompressed_size, bool allow_implicit) { bool needs_end_of_input = false; @@ -62,17 +62,19 @@ prepare(lzma_vli *id, lzma_vli *uncompressed_size, bool implicit) // Is this the last filter in the chain? if (id[1] == LZMA_VLI_VALUE_UNKNOWN) { - if (!needs_end_of_input || !implicit || uncompressed_size[0] - != LZMA_VLI_VALUE_UNKNOWN) - return false; + if (needs_end_of_input && allow_implicit + && uncompressed_size[0] + == LZMA_VLI_VALUE_UNKNOWN) { + // Add implicit Subblock filter. + id[1] = LZMA_FILTER_SUBBLOCK; + uncompressed_size[1] = LZMA_VLI_VALUE_UNKNOWN; + id[2] = LZMA_VLI_VALUE_UNKNOWN; + } - // Add implicit Subblock filter. - id[1] = LZMA_FILTER_SUBBLOCK; - uncompressed_size[1] = LZMA_VLI_VALUE_UNKNOWN; - id[2] = LZMA_VLI_VALUE_UNKNOWN; + return false; } - return prepare(id + 1, uncompressed_size + 1, implicit); + return prepare(id + 1, uncompressed_size + 1, allow_implicit); } |