Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Will Jones <[email protected]>
  • Loading branch information
westonpace and wjones127 authored Dec 5, 2023
1 parent 1c72fa2 commit d359f57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arrow-select/src/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,12 @@ where
.ok_or_else(|| ArrowError::ComputeError("Cast to usize failed".to_string()))?;
let start = list.value_offset(index) as <UInt32Type as ArrowPrimitiveType>::Native;

values.extend((start..start + length).map(Some));
// Safety: Range always has known length.
unsafe {
values.append_trusted_len_iter(start..start + length);
}
} else {
values.extend((0..length).map(|_| None));
values.append_nulls(length);
}
}

Expand Down

0 comments on commit d359f57

Please sign in to comment.