Skip to content

Commit 0e40f55

Browse files
Apply suggestions from code review
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent f59718e commit 0e40f55

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

Doc/library/compression.zstd.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ Advanced parameter control
646646
Write the size of the data to be compressed into the Zstandard frame
647647
header when known prior to compressing.
648648

649-
This flag only takes effect under the following three scenarios:
649+
This flag only takes effect under the following scenarios:
650650

651651
* Calling :func:`compress` for one-shot compression
652652
* Providing all of the data to be compressed in the frame in a single

Modules/_zstd/compressor.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,8 @@ _zstd.ZstdCompressor.set_pledged_input_size
749749
Set the uncompressed content size to be written into the frame header.
750750
751751
This method can be used to ensure the header of the frame about to be written
752-
includes the size of the data, unless CompressionParameter.content_size_flag is
753-
set to False. If last_mode != FLUSH_FRAME, then a RuntimeError is raised.
752+
includes the size of the data, unless the CompressionParameter.content_size_flag
753+
is set to False. If last_mode != FLUSH_FRAME, then a RuntimeError is raised.
754754
755755
It is important to ensure that the pledged data size matches the actual data
756756
size. If they do not match the compressed output data may be corrupted and the
@@ -762,8 +762,6 @@ _zstd_ZstdCompressor_set_pledged_input_size_impl(ZstdCompressor *self,
762762
unsigned long long size)
763763
/*[clinic end generated code: output=3a09e55cc0e3b4f9 input=563b9a1ddd4facc3]*/
764764
{
765-
size_t zstd_ret;
766-
767765
// Error occured while converting argument, should be unreachable
768766
assert(size != ZSTD_CONTENTSIZE_ERROR);
769767

@@ -780,7 +778,7 @@ _zstd_ZstdCompressor_set_pledged_input_size_impl(ZstdCompressor *self,
780778
}
781779

782780
/* Set pledged content size */
783-
zstd_ret = ZSTD_CCtx_setPledgedSrcSize(self->cctx, size);
781+
size_t zstd_ret = ZSTD_CCtx_setPledgedSrcSize(self->cctx, size);
784782
PyMutex_Unlock(&self->lock);
785783
if (ZSTD_isError(zstd_ret)) {
786784
_zstd_state* mod_state = PyType_GetModuleState(Py_TYPE(self));

0 commit comments

Comments
 (0)