1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-25 21:23:53 +01:00

Enable readability-qualified-auto check (#3095)

This commit is contained in:
Oxan van Leeuwen
2022-01-23 08:29:58 +01:00
committed by GitHub
parent 7854522792
commit a31700e16f
34 changed files with 59 additions and 58 deletions

View File

@@ -104,7 +104,7 @@ void IRAM_ATTR HOT RotaryEncoderSensorStore::gpio_intr(RotaryEncoderSensorStore
}
if (rotation_dir != 0) {
auto first_zero = std::find(arg->rotation_events.begin(), arg->rotation_events.end(), 0); // find first zero
auto *first_zero = std::find(arg->rotation_events.begin(), arg->rotation_events.end(), 0); // find first zero
if (first_zero == arg->rotation_events.begin() // are we at the start (first event this loop iteration)
|| std::signbit(*std::prev(first_zero)) !=
std::signbit(rotation_dir) // or is the last stored event the wrong direction