From 343003b757ad015a8c1e93dd463e64d311a0492b Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Fri, 20 May 2022 13:10:33 -0400 Subject: [PATCH 1/2] code clean up --- src/controller/InvokeInteraction.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/controller/InvokeInteraction.h b/src/controller/InvokeInteraction.h index 4af4b5e5378204..784369af2599cd 100644 --- a/src/controller/InvokeInteraction.h +++ b/src/controller/InvokeInteraction.h @@ -105,7 +105,6 @@ template CHIP_ERROR InvokeGroupCommandRequest(Messaging::ExchangeManager * exchangeMgr, chip::FabricIndex fabric, chip::GroupId groupId, const RequestObjectT & requestCommandData) { - CHIP_ERROR error = CHIP_NO_ERROR; app::CommandPathParams commandPath = { groupId, RequestObjectT::GetClusterId(), RequestObjectT::GetCommandId(), app::CommandPathFlags::kGroupIdValid }; Transport::OutgoingGroupSession session(groupId, fabric); @@ -113,15 +112,9 @@ CHIP_ERROR InvokeGroupCommandRequest(Messaging::ExchangeManager * exchangeMgr, c auto commandSender = chip::Platform::MakeUnique(nullptr, exchangeMgr); VerifyOrReturnError(commandSender != nullptr, CHIP_ERROR_NO_MEMORY); - error = commandSender->AddRequestData(commandPath, requestCommandData); - SuccessOrExit(error); - error = commandSender->SendGroupCommandRequest(SessionHandle(session)); - SuccessOrExit(error); - -exit: - chip::Platform::Delete(commandSender.release()); - return error; + ReturnErrorOnFailure(commandSender->AddRequestData(commandPath, requestCommandData)); + return commandSender->SendGroupCommandRequest(SessionHandle(session)); } template From 20d956192bc3b44bd9f1506ce9790869210d83f4 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 20 May 2022 17:13:12 +0000 Subject: [PATCH 2/2] Restyled by clang-format --- src/controller/InvokeInteraction.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/controller/InvokeInteraction.h b/src/controller/InvokeInteraction.h index 784369af2599cd..2e8816553bb8b3 100644 --- a/src/controller/InvokeInteraction.h +++ b/src/controller/InvokeInteraction.h @@ -112,7 +112,6 @@ CHIP_ERROR InvokeGroupCommandRequest(Messaging::ExchangeManager * exchangeMgr, c auto commandSender = chip::Platform::MakeUnique(nullptr, exchangeMgr); VerifyOrReturnError(commandSender != nullptr, CHIP_ERROR_NO_MEMORY); - ReturnErrorOnFailure(commandSender->AddRequestData(commandPath, requestCommandData)); return commandSender->SendGroupCommandRequest(SessionHandle(session)); }