Skip to content

Commit

Permalink
single alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Apr 1, 2024
1 parent d3273d9 commit 3f38436
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/polars-arrow/src/compute/temporal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,8 @@ where
TimeUnit::Microsecond => timestamp_us_to_datetime,
TimeUnit::Nanosecond => timestamp_ns_to_datetime,
};
Ok(PrimitiveArray::<O>::from(
array
.iter()
.map(|v| v.map(|x| op(func(*x))))
.collect::<Vec<_>>(),
Ok(PrimitiveArray::<O>::from_iter(
array.iter().map(|v| v.map(|x| op(func(*x)))),
))
},
_ => unreachable!(),
Expand Down

0 comments on commit 3f38436

Please sign in to comment.