Formatting: use early continue pattern
This commit is contained in:
@@ -234,18 +234,18 @@ void UdpCommandDemuxer::processIncomingData()
|
|||||||
// Found matching device in temporary collection, invoke matching handlers
|
// Found matching device in temporary collection, invoke matching handlers
|
||||||
for (const auto& cmdHandler : tempIt->second)
|
for (const auto& cmdHandler : tempIt->second)
|
||||||
{
|
{
|
||||||
if (cmdHandler.cmd_set == cmd_set && cmdHandler.cmd_id == cmd_id)
|
if (cmdHandler.cmd_set != cmd_set || cmdHandler.cmd_id != cmd_id)
|
||||||
|
{ continue; }
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
try
|
cmdHandler.handler(receiveBuffer, bytesReceived, senderAddr);
|
||||||
{
|
}
|
||||||
cmdHandler.handler(receiveBuffer, bytesReceived, senderAddr);
|
catch (const std::exception &e)
|
||||||
}
|
{
|
||||||
catch (const std::exception &e)
|
std::cerr
|
||||||
{
|
<< __func__ << ": Temporary device handler exception for IP "
|
||||||
std::cerr
|
<< sourceIP << ": " << e.what() << std::endl;
|
||||||
<< __func__ << ": Temporary device handler exception for IP "
|
|
||||||
<< sourceIP << ": " << e.what() << std::endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user