tustvold commented on code in PR #4380:
URL: https://github.com/apache/arrow-rs/pull/4380#discussion_r1223314766
##########
arrow-array/src/array/primitive_array.rs:
##########
@@ -299,6 +299,17 @@ impl<T: ArrowPrimitiveType> PrimitiveArray<T> {
/// # Panics
///
/// Panics if [`Self::try_new`] returns an error
+ ///
+ /// ```
+ /// # use arrow_array::Int32Array;
+ /// # use arrow_array::types::Int32Type;
+ /// # use arrow_buffer::NullBuffer;
+ /// // [1, 2, 3, 4]
+ /// let array = Int32Array::new(vec![1, 2, 3, 4].into(), None);
+ /// // [1, null, 3, 4]
+ /// let nulls = NullBuffer::from(vec![true, false, true, true]);
Review Comment:
It would eliminate the allocation for the Vec, although the compiler might
be smart enough to do that anyway, will update
--
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]