alamb commented on code in PR #11993:
URL: https://github.com/apache/arrow-rs/pull/11993#discussion_r4428413638
##########
arrow-select/src/coalesce/primitive.rs:
##########
@@ -61,23 +61,30 @@ impl<T: ArrowPrimitiveType> InProgressPrimitiveArray<T> {
}
}
- fn append_values_by_indices(
+ /// # Safety
+ ///
+ /// Every index yielded by `indices` must be less than `values.len()`, and
+ /// `indices` must yield exactly `selected_count` indices.
+ unsafe fn append_values_by_indices(
current: &mut Vec<T::Native>,
values: &[T::Native],
indices: FilterIndices<'_>,
selected_count: usize,
) {
+ current.reserve(selected_count);
Review Comment:
this avoids requiring the caller to gurantee capacity I think
--
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]