doki23 commented on code in PR #5440:
URL: https://github.com/apache/arrow-rs/pull/5440#discussion_r1525718954
##########
arrow-buffer/src/builder/offset.rs:
##########
@@ -142,9 +135,9 @@ impl<O: ArrowNativeType + Add<Output = O> + Sub<Output =
O>> Extend<O> for Offse
None => lengths_iter.size_hint().0,
};
self.reserve(size_hint);
- for len in lengths_iter {
- self.push_length(len);
- }
+ lengths_iter.for_each(|len| unsafe {
Review Comment:
Function `push_length_unchecked` convert usize length to `O` by
`O::usize_as` which is unsafe.
##########
arrow-buffer/src/builder/offset.rs:
##########
@@ -142,9 +135,9 @@ impl<O: ArrowNativeType + Add<Output = O> + Sub<Output =
O>> Extend<O> for Offse
None => lengths_iter.size_hint().0,
};
self.reserve(size_hint);
- for len in lengths_iter {
- self.push_length(len);
- }
+ lengths_iter.for_each(|len| unsafe {
Review Comment:
Function `push_length_unchecked` converts usize length to `O` by
`O::usize_as` which is unsafe.
--
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]