Skip to content

Commit

Permalink
collect directly into buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Jul 29, 2024
1 parent f47b133 commit 6b890e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/polars-arrow/src/legacy/kernels/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use crate::buffer::Buffer;
use crate::datatypes::ArrowDataType;

pub fn binary_size_bytes(array: &BinaryViewArray) -> ArrayRef {
let values = array.len_iter().collect::<Vec<_>>();
let values: Buffer<_> = values.into();
let values: Buffer<_> = array.len_iter().collect();
let array = UInt32Array::new(ArrowDataType::UInt32, values, array.validity().cloned());
Box::new(array)
}

0 comments on commit 6b890e6

Please sign in to comment.