Dandandan commented on code in PR #9229:
URL: https://github.com/apache/arrow-rs/pull/9229#discussion_r2708505356
##########
arrow-select/src/filter.rs:
##########
@@ -91,6 +91,24 @@ impl<'a> IndexIterator<'a> {
let iter = filter.values().set_indices();
Self { remaining, iter }
}
+
+ /// Collect this iterator as a [`Vec`]
+ pub fn collect(mut self) -> Vec<usize> {
+ let len = self.remaining;
+ let mut result = Vec::with_capacity(len);
+ let ptr: *mut usize = result.as_mut_ptr();
+ for i in 0..len {
+ // SAFETY: we have allocated enough space in `result`
Review Comment:
Done!
--
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]