mirror of
https://github.com/esphome/esphome.git
synced 2025-11-10 11:55:52 +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:
@@ -96,7 +96,7 @@ float ADCSensor::sample() {
|
|||||||
}
|
}
|
||||||
sum += raw;
|
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_) {
|
if (this->output_raw_) {
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user