mirror of
https://github.com/esphome/esphome.git
synced 2025-10-08 04:43:46 +01:00
[pid] Fix clang-tidy sign comparison error (#11063)
This commit is contained in:
@@ -104,7 +104,7 @@ float PIDController::weighted_average_(std::deque<float> &list, float new_value,
|
|||||||
list.push_front(new_value);
|
list.push_front(new_value);
|
||||||
|
|
||||||
// keep only 'samples' readings, by popping off the back of the list
|
// keep only 'samples' readings, by popping off the back of the list
|
||||||
while (list.size() > samples)
|
while (samples > 0 && list.size() > static_cast<size_t>(samples))
|
||||||
list.pop_back();
|
list.pop_back();
|
||||||
|
|
||||||
// calculate and return the average of all values in the list
|
// calculate and return the average of all values in the list
|
||||||
|
Reference in New Issue
Block a user