etseidl commented on code in PR #9584:
URL: https://github.com/apache/arrow-rs/pull/9584#discussion_r2977811126


##########
parquet/src/util/bit_util.rs:
##########
@@ -659,16 +659,23 @@ impl BitReader {
     ///
     /// Returns `None` if there's not enough bytes in the stream. `Some` 
otherwise.
     pub fn get_vlq_int(&mut self) -> Option<i64> {
+        // Align to byte boundary once, then read bytes directly
+        self.byte_offset = self.get_byte_offset();
+        self.bit_offset = 0;
+
+        let buf = &self.buffer[self.byte_offset..];

Review Comment:
   I was going to ask about bounds checking, but it seems like `byte_offset` 
won't ever get too big, so at worst this will return an empty slice, resulting 
in a return of `None`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to