jhorstmann commented on code in PR #9393:
URL: https://github.com/apache/arrow-rs/pull/9393#discussion_r2847871965


##########
arrow-buffer/src/buffer/mutable.rs:
##########
@@ -1088,8 +1088,15 @@ impl std::iter::FromIterator<bool> for MutableBuffer {
 
 impl<T: ArrowNativeType> std::iter::FromIterator<T> for MutableBuffer {
     fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
-        let mut buffer = Self::default();
-        buffer.extend_from_iter(iter.into_iter());
+        let into_iter = iter.into_iter();

Review Comment:
   Since this creates a new `MutableBuffer`, we could also do something like 
   ```
   MutableBuffer::from(iter.into_iter().collect::<Vec<_>>())
   ```
   
   That would enable any optimizations that `Vec` has internally for trusted 
length iterators.



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