From 13a948a2d35f392f28d6cc985e102bc26edaa4c2 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Thu, 30 Oct 2025 22:18:02 -0400 Subject: [PATCH] Formatting: use early continue pattern --- commonLibs/livoxProto1/udpCommandDemuxer.cpp | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/commonLibs/livoxProto1/udpCommandDemuxer.cpp b/commonLibs/livoxProto1/udpCommandDemuxer.cpp index 5f656d9..001237f 100644 --- a/commonLibs/livoxProto1/udpCommandDemuxer.cpp +++ b/commonLibs/livoxProto1/udpCommandDemuxer.cpp @@ -234,18 +234,18 @@ void UdpCommandDemuxer::processIncomingData() // Found matching device in temporary collection, invoke matching handlers 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); - } - catch (const std::exception &e) - { - std::cerr - << __func__ << ": Temporary device handler exception for IP " - << sourceIP << ": " << e.what() << std::endl; - } + cmdHandler.handler(receiveBuffer, bytesReceived, senderAddr); + } + catch (const std::exception &e) + { + std::cerr + << __func__ << ": Temporary device handler exception for IP " + << sourceIP << ": " << e.what() << std::endl; } } }