GregBowyer commented on a change in pull request #8698:
URL: https://github.com/apache/arrow/pull/8698#discussion_r534657727



##########
File path: rust/parquet/src/util/bit_util.rs
##########
@@ -124,11 +125,7 @@ where
 /// Returns the ceil of value/divisor
 #[inline]
 pub fn ceil(value: i64, divisor: i64) -> i64 {
-    let mut result = value / divisor;
-    if value % divisor != 0 {
-        result += 1
-    };
-    result
+    value / divisor + ((value % divisor != 0) as i64)

Review comment:
       Performance notes:
   
   Small but measurable performance tweak, we can elide the branch and add on 
the `+1` from the gaurentees about the representation of the boolean




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

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


Reply via email to