1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-01 00:08:15 +00:00

Reverting the clang-analyzer-core.DivideZero

There is a protection for this on the set_sample_count function, so I've ignored clang-analyzer just like in the original code.
This commit is contained in:
Edward Firmo 2024-12-09 20:06:35 +01:00
parent fa437896a1
commit bf2823a52c

View File

@ -96,7 +96,7 @@ float ADCSensor::sample() {
}
sum += raw;
}
sum = (sum + (this->sample_count_ >> 1)) / this->sample_count_;
sum = (sum + (this->sample_count_ >> 1)) / this->sample_count_; // NOLINT(clang-analyzer-core.DivideZero)
if (this->output_raw_) {
return sum;
}