Skip to content

Commit

Permalink
GzipPartialDecoder use partial_decode_opt
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Nov 12, 2023
1 parent be119dc commit 2f51006
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/array/codec/bytes_to_bytes/gzip/gzip_partial_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ impl BytesPartialDecoderTraits for GzipPartialDecoder<'_> {
decoded_regions: &[ByteRange],
parallel: bool,
) -> Result<Option<Vec<Vec<u8>>>, CodecError> {
let encoded_value = if parallel {
self.input_handle
.par_partial_decode(&[ByteRange::FromStart(0, None)])?
} else {
self.input_handle
.partial_decode(&[ByteRange::FromStart(0, None)])?
}
.map(|mut bytes| bytes.remove(0));
let encoded_value = self
.input_handle
.partial_decode_opt(&[ByteRange::FromStart(0, None)], parallel)?
.map(|mut bytes| bytes.remove(0));
let Some(encoded_value) = encoded_value else {
return Ok(None);
};
Expand Down

0 comments on commit 2f51006

Please sign in to comment.