mirror of
https://github.com/esphome/esphome.git
synced 2025-10-08 21:03:49 +01:00
[api] Simplify message reading conditional (#11016)
This commit is contained in:
@@ -169,11 +169,8 @@ void APIConnection::loop() {
|
|||||||
} else {
|
} else {
|
||||||
this->last_traffic_ = now;
|
this->last_traffic_ = now;
|
||||||
// read a packet
|
// read a packet
|
||||||
if (buffer.data_len > 0) {
|
this->read_message(buffer.data_len, buffer.type,
|
||||||
this->read_message(buffer.data_len, buffer.type, &buffer.container[buffer.data_offset]);
|
buffer.data_len > 0 ? &buffer.container[buffer.data_offset] : nullptr);
|
||||||
} else {
|
|
||||||
this->read_message(0, buffer.type, nullptr);
|
|
||||||
}
|
|
||||||
if (this->flags_.remove)
|
if (this->flags_.remove)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user