tustvold commented on code in PR #4621:
URL: https://github.com/apache/arrow-rs/pull/4621#discussion_r1281535384


##########
arrow-buffer/src/buffer/mutable.rs:
##########
@@ -168,7 +168,18 @@ impl MutableBuffer {
     /// `len` of the buffer and so can be used to initialize the memory region 
from
     /// `len` to `capacity`.
     pub fn set_null_bits(&mut self, start: usize, count: usize) {
-        assert!(start + count <= self.layout.size());
+        if start
+            .checked_add(count)

Review Comment:
   FWIW using saturating_add would be equivalent and slightly more concise, 
this is what we do elsewhere



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