Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiayi771 committed Dec 16, 2023
1 parent f63dc38 commit 8f68b66
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion velox/functions/lib/aggregates/CentralMomentsAggregatesBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct CentralMomentsIndices {
constexpr CentralMomentsIndices kCentralMomentsIndices{0, 1, 2, 3, 4};

struct CentralMomentsAccumulator {
double count() const {
int64_t count() const {
return count_;
}

Expand Down Expand Up @@ -83,6 +83,14 @@ struct CentralMomentsAccumulator {
if (otherCount == 0) {
return;
}
if (count_ == 0) {
count_ = otherCount;
m1_ = otherM1;
m2_ = otherM2;
m3_ = otherM3;
m4_ = otherM4;
return;
}

double oldCount = count();
count_ += otherCount;
Expand Down

0 comments on commit 8f68b66

Please sign in to comment.