skip a few parsing steps if the buffer is empty

This commit is contained in:
Kevin Matz 2023-04-09 19:56:32 -04:00
parent 32c6ccb60c
commit ea3bf9e5e8

View File

@ -66,6 +66,8 @@ void DmxWidget::parseMessageBuffer()
uint16_t length;
const int fixed_length = 5; // start + label + 2xlength + end
auto fast_forward = [this](int offset = 0) {
if (message_rx_buffer_.isEmpty())
return false;
if (offset == 0)
offset = message_rx_buffer_.indexOf(ENTTEC::Pro::START_DELIMITER);
if (offset < 0)