From ec0298a38d7482c6ac9b1f6dc61f3836266437c4 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 23 Jan 2025 10:24:28 -0800 Subject: [PATCH] Remove extra else --- .../codegen/CodegenDataModelProvider.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/data-model-providers/codegen/CodegenDataModelProvider.cpp b/src/data-model-providers/codegen/CodegenDataModelProvider.cpp index 8e06cf5f88f89f..071d63032633e1 100644 --- a/src/data-model-providers/codegen/CodegenDataModelProvider.cpp +++ b/src/data-model-providers/codegen/CodegenDataModelProvider.cpp @@ -343,13 +343,11 @@ std::optional CodegenDataModelProvider::Invoke(co { return std::nullopt; } - else - { - // If we reach here, it means this particular CommandHandlerInterface recognized the cluster but the command is invalid - // or cannot be processed. - handler->AddStatus(request.path, Protocols::InteractionModel::Status::InvalidCommand); - return std::nullopt; - } + + // If we reach here, it means this particular CommandHandlerInterface recognized the cluster but the command is invalid + // or cannot be processed. + handler->AddStatus(request.path, Protocols::InteractionModel::Status::InvalidCommand); + return std::nullopt; } // Ember always sets the return in the handler