Skip to content

Commit 5000a58

Browse files
authored
Refactor lambda function to make the control flow more visible. (#16)
1 parent 0faf9ab commit 5000a58

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/serial/SerialDispatcher.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ void SerialDispatcher::threadFunc()
187187
std::end (_thread_customer_list),
188188
[this](ThreadCustomerData & d)
189189
{
190-
if (!d.block_tx_buffer)
190+
if (d.block_tx_buffer)
191+
return;
192+
193+
while(d.tx_buffer.available())
191194
{
192-
while(d.tx_buffer.available())
193-
{
194-
_serial.write(d.tx_buffer.read_char());
195-
}
195+
_serial.write(d.tx_buffer.read_char());
196196
}
197197
});
198198
}

0 commit comments

Comments
 (0)