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


##########
parquet/src/parquet_thrift.rs:
##########
@@ -212,10 +212,10 @@ pub(crate) trait ThriftCompactInputProtocol<'a> {
         loop {
             let byte = self.read_byte()?;
             in_progress |= ((byte & 0x7F) as u64).wrapping_shl(shift);
-            shift += 7;
             if byte & 0x80 == 0 {
                 return Ok(in_progress);
             }
+            shift += 7;

Review Comment:
   Attempt at a minor performance enhancement. There's no need to increment 
`shift` if we're going to return, so I moved the increment to after the 
evaluation. It seemed to help a little, but I never actually threw the code 
into godbolt to see if the compiled code differs.



-- 
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