Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions parquet/src/parquet_thrift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,13 @@ pub(crate) trait ThriftCompactInputProtocol<'a> {

/// Read a ULEB128 encoded unsigned varint from the input.
fn read_vlq(&mut self) -> ThriftProtocolResult<u64> {
let mut in_progress = 0;
let mut shift = 0;
// try the happy path first
let byte = self.read_byte()?;
if byte & 0x80 == 0 {
return Ok(byte as u64);
}
let mut in_progress = (byte & 0x7f) as u64;
let mut shift = 7;
loop {
let byte = self.read_byte()?;
in_progress |= ((byte & 0x7F) as u64).wrapping_shl(shift);
Expand Down
Loading