Skip to content

Commit d2b5d29

Browse files
committed
Don't collect
1 parent dc0c45e commit d2b5d29

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

arrow-select/src/coalesce/primitive.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,26 +158,21 @@ impl<T: ArrowPrimitiveType + Debug> InProgressArray for InProgressPrimitiveArray
158158
let null_offset = null_buffer.offset();
159159

160160
// Collect indices for reuse (values + nulls)
161-
let indices: Vec<usize> =
162-
IndexIterator::new(filter.filter_array(), count).collect();
161+
let indices = IndexIterator::new(filter.filter_array(), count);
163162

164163
// Efficiently extend null buffer
165164
// SAFETY: indices iterator reports correct length
166165
unsafe {
167166
self.nulls.extend_from_trusted_len_iter(
168-
indices
169-
.iter()
170-
.map(|&idx| bit_util::get_bit_raw(null_ptr, idx + null_offset)),
167+
indices.map(|idx| bit_util::get_bit_raw(null_ptr, idx + null_offset)),
171168
);
172169
}
170+
let indices = IndexIterator::new(filter.filter_array(), count);
173171

174172
// Copy values
175173
// SAFETY: indices are derived from filter predicate
176-
self.current.extend(
177-
indices
178-
.iter()
179-
.map(|&idx| unsafe { *values.get_unchecked(idx) }),
180-
);
174+
self.current
175+
.extend(indices.map(|idx| unsafe { *values.get_unchecked(idx) }));
181176
} else {
182177
self.nulls.append_n_non_nulls(count);
183178
let indices = IndexIterator::new(filter.filter_array(), count);

0 commit comments

Comments
 (0)