handle unlikely

This commit is contained in:
J. Nick Koston
2026-02-06 23:12:00 +01:00
parent 572376091e
commit 67e7ba4812

View File

@@ -27,7 +27,9 @@ void CSE7766Component::loop() {
uint8_t buf[CSE7766_RAW_DATA_SIZE];
while (avail > 0) {
size_t to_read = std::min(static_cast<size_t>(avail), sizeof(buf));
this->read_array(buf, to_read);
if (!this->read_array(buf, to_read)) {
break;
}
avail -= to_read;
for (size_t i = 0; i < to_read; i++) {