From 3a10418ae16cfe8aeba9b16d73e892bab85b6fe1 Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Tue, 5 Mar 2024 11:11:00 +0000 Subject: [PATCH] Primitive stats --- vortex/src/array/primitive/stats.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vortex/src/array/primitive/stats.rs b/vortex/src/array/primitive/stats.rs index 406680aad5..3739a3c945 100644 --- a/vortex/src/array/primitive/stats.rs +++ b/vortex/src/array/primitive/stats.rs @@ -24,7 +24,7 @@ impl StatsCompute for PrimitiveArray { } } -impl<'a, T: NativePType> StatsCompute for &[T] { +impl StatsCompute for &[T] { fn compute(&self, _stat: &Stat) -> VortexResult { if self.is_empty() { return Ok(StatsSet::default()); @@ -112,9 +112,9 @@ struct StatsAccumulator { impl StatsAccumulator { fn new(first_value: T) -> Self { let mut stats = Self { - prev: first_value.clone(), - min: first_value.clone(), - max: first_value.clone(), + prev: first_value, + min: first_value, + max: first_value, is_sorted: true, is_strict_sorted: true, run_count: 1, @@ -124,7 +124,7 @@ impl StatsAccumulator { stats } - pub fn next(self: &mut Self, next: T) { + pub fn next(&mut self, next: T) { self.bit_widths[next.bit_width()] += 1; if self.prev == next { @@ -143,7 +143,7 @@ impl StatsAccumulator { self.prev = next; } - pub fn into_set(self: Self) -> StatsSet { + pub fn into_set(self) -> StatsSet { StatsSet::from(HashMap::from([ (Stat::Min, self.min.into()), (Stat::Max, self.max.into()),