Formatting: use early continue pattern

This commit is contained in:
2025-10-30 22:18:02 -04:00
parent 07c48d78d1
commit 13a948a2d3
+11 -11
View File
@@ -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;
}
} }
} }
} }