Skip to content

Commit

Permalink
Primitive stats
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn committed Mar 5, 2024
1 parent e751267 commit 3a10418
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions vortex/src/array/primitive/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl StatsCompute for PrimitiveArray {
}
}

impl<'a, T: NativePType> StatsCompute for &[T] {
impl<T: NativePType> StatsCompute for &[T] {
fn compute(&self, _stat: &Stat) -> VortexResult<StatsSet> {
if self.is_empty() {
return Ok(StatsSet::default());
Expand Down Expand Up @@ -112,9 +112,9 @@ struct StatsAccumulator<T: SupportsPrimitiveStats> {
impl<T: SupportsPrimitiveStats> StatsAccumulator<T> {
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,
Expand All @@ -124,7 +124,7 @@ impl<T: SupportsPrimitiveStats> StatsAccumulator<T> {
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 {
Expand All @@ -143,7 +143,7 @@ impl<T: SupportsPrimitiveStats> StatsAccumulator<T> {
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()),
Expand Down

0 comments on commit 3a10418

Please sign in to comment.