Skip to content

Commit

Permalink
less
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 committed Mar 5, 2024
1 parent f63e8fd commit 19473b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
8 changes: 0 additions & 8 deletions vortex-array/src/array/bool/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use crate::compute::scalar_at::ScalarAtFn;
use crate::compute::ArrayCompute;
use crate::error::VortexResult;
use crate::scalar::{NullableScalar, Scalar, ScalarRef};
use crate::stats::Stat;

impl ArrayCompute for BoolArray {
fn cast_bool(&self) -> Option<&dyn CastBoolFn> {
Expand Down Expand Up @@ -42,13 +41,6 @@ impl FillForwardFn for BoolArray {
fn fill_forward(&self) -> VortexResult<ArrayRef> {
if self.validity().is_none() {
Ok(dyn_clone::clone_box(self))
} else if self
.stats()
.get_or_compute_as::<usize>(&Stat::NullCount)
.unwrap()
== 0usize
{
return Ok(BoolArray::new(self.buffer().clone(), None).boxed());
} else {
let validity = cast_bool(self.validity().unwrap())?;
let bools = self.buffer();
Expand Down
3 changes: 1 addition & 2 deletions vortex-array/src/array/bool/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ impl StatsCompute for BoolArray {
let mut prev_bit = self.buffer().value(0);
let mut true_count: usize = if prev_bit { 1 } else { 0 };
let mut run_count: usize = 0;
for i in 1..self.len() {
let bit = self.buffer().value(i);
for bit in self.buffer().iter().skip(1) {
if bit {
true_count += 1
}
Expand Down

0 comments on commit 19473b7

Please sign in to comment.