Skip to content

Commit

Permalink
Minor improvement (#1463)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Sep 30, 2021
1 parent 0af94e1 commit 8e045d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions polars/polars-arrow/src/kernels/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ where
if truthy {
av.extend_from_slice(&values[lower..upper])
} else {
av.extend((lower..upper).map(|_| value))
av.extend_from_trusted_len_iter(std::iter::repeat(value).take(upper - lower))
}
});

Expand All @@ -48,7 +48,7 @@ pub fn set_with_mask<T: NativeType>(
.into_iter()
.for_each(|(lower, upper, truthy)| {
if truthy {
buf.extend((lower..upper).map(|_| value))
buf.extend_from_trusted_len_iter(std::iter::repeat(value).take(upper - lower))
} else {
buf.extend_from_slice(&values[lower..upper])
}
Expand Down
6 changes: 1 addition & 5 deletions polars/polars-core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,7 @@ macro_rules! static_zip {
macro_rules! df {
($($col_name:expr => $slice:expr), +) => {
{
let mut columns = vec![];
$(
columns.push(Series::new($col_name, $slice));
)+
DataFrame::new(columns)
DataFrame::new(vec![$(Series::new($col_name, $slice),)+])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion polars/polars-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ahash = "0.7"
num = "^0.4.0"
dirs = "3.0"
simdutf8 = {version="0.1", optional=true}
flate2 = {version = "1", optional=true, --default-features=false}
flate2 = {version = "1", optional=true, default-features=false}

[package.metadata.docs.rs]
all-features = true
Expand Down

0 comments on commit 8e045d5

Please sign in to comment.