From b7c4f668aefcc8a9c355f5da99a1b74ac11417c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kr=C3=A1l?= Date: Sun, 16 May 2021 12:00:15 +0200 Subject: [PATCH] remove redundant subrange and outdated comments --- src/decoder/mod.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index 42c52e0..43dccb0 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -1087,7 +1087,6 @@ impl Decoder { } /// Decompresses the strip into the supplied buffer. - /// Returns the number of bytes read. fn expand_strip<'a>( &mut self, mut buffer: DecodingBuffer<'a>, @@ -1143,19 +1142,16 @@ impl Decoder { } } - let len = buffer.len(); - Self::fix_endianness(&mut buffer.subrange(0..len), byte_order); + Self::fix_endianness(&mut buffer, byte_order); - // Invert colors if necessary. if self.photometric_interpretation == PhotometricInterpretation::WhiteIsZero { - Self::invert_colors(&mut buffer.subrange(0..len), color_type); + Self::invert_colors(&mut buffer, color_type); } Ok(()) } /// Decompresses the tile into the supplied buffer. - /// Returns the number of bytes read. fn expand_tile<'a>( &mut self, mut buffer: DecodingBuffer<'a>, @@ -1214,7 +1210,6 @@ impl Decoder { Self::fix_endianness(&mut buffer.subrange(row_start..row_end), self.byte_order); - // Invert colors if necessary. if self.photometric_interpretation == PhotometricInterpretation::WhiteIsZero { Self::invert_colors(&mut buffer.subrange(row_start..row_end), color_type); }