Skip to content

Commit

Permalink
skip iterator removed from primitive encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
korowa committed Jun 8, 2024
1 parent 087f34b commit 4fec097
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arrow-row/src/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ pub fn encode<T: FixedLengthEncoding, I: IntoIterator<Item = Option<T>>>(
i: I,
opts: SortOptions,
) {
for (offset, maybe_val) in offsets.iter_mut().skip(1).zip(i) {
let mut offset_idx = 1;
for maybe_val in i {
let offset = &mut offsets[offset_idx];
let end_offset = *offset + T::ENCODED_LEN;
if let Some(val) = maybe_val {
let to_write = &mut data[*offset..end_offset];
Expand All @@ -237,6 +239,7 @@ pub fn encode<T: FixedLengthEncoding, I: IntoIterator<Item = Option<T>>>(
data[*offset] = null_sentinel(opts);
}
*offset = end_offset;
offset_idx += 1;
}
}

Expand Down

0 comments on commit 4fec097

Please sign in to comment.