alamb commented on code in PR #9819:
URL: https://github.com/apache/arrow-rs/pull/9819#discussion_r3149542575
##########
arrow-buffer/src/buffer/mutable.rs:
##########
@@ -284,9 +284,15 @@ impl MutableBuffer {
}
let bytes_to_repeat = size_of_val(slice_to_repeat);
+ let repeated_bytes = repeat_count
+ .checked_mul(bytes_to_repeat)
+ .expect("repeated slice byte length overflow");
+ self.len
+ .checked_add(repeated_bytes)
+ .expect("mutable buffer length overflow");
Review Comment:
I think it would be fine to add another function like
`try_repeat_slice_n_times...` that returned a Result for those that wanted it
--
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]