From 19473b7590605a8e72059fe7a379d0f3ab5e5c89 Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Tue, 5 Mar 2024 15:52:40 +0000 Subject: [PATCH] less --- vortex-array/src/array/bool/compute.rs | 8 -------- vortex-array/src/array/bool/stats.rs | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/vortex-array/src/array/bool/compute.rs b/vortex-array/src/array/bool/compute.rs index 62ee62a21d..2cbf1c077a 100644 --- a/vortex-array/src/array/bool/compute.rs +++ b/vortex-array/src/array/bool/compute.rs @@ -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> { @@ -42,13 +41,6 @@ impl FillForwardFn for BoolArray { fn fill_forward(&self) -> VortexResult { if self.validity().is_none() { Ok(dyn_clone::clone_box(self)) - } else if self - .stats() - .get_or_compute_as::(&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(); diff --git a/vortex-array/src/array/bool/stats.rs b/vortex-array/src/array/bool/stats.rs index f875e5933a..cf71e8622f 100644 --- a/vortex-array/src/array/bool/stats.rs +++ b/vortex-array/src/array/bool/stats.rs @@ -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 }