Implement bugprone-branch-clone compliance

As part of getting the clang-tidy bugprone tests running, these
conditionals were found to have duplicate entries, or be somewhat
nonsensical.

Tested: clang-tidy now passes with the branch-compliance check set.
Change-Id: Ibec106f3bbd866fc471a1fc56bd8cdd5d44024e0
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index dd63913..897c5c4 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -143,8 +143,11 @@
         messages::resourceNotFound(
             asyncResp->res, "#ManagerAccount.v1_4_0.ManagerAccount", username);
     }
-    else if (strcmp(errorMessage,
-                    "xyz.openbmc_project.Common.Error.InvalidArgument") == 0)
+    else if ((strcmp(errorMessage,
+                     "xyz.openbmc_project.Common.Error.InvalidArgument") ==
+              0) ||
+             (strcmp(errorMessage, "xyz.openbmc_project.User.Common.Error."
+                                   "UserNameGroupFail") == 0))
     {
         messages::propertyValueFormatError(asyncResp->res, newUser, "UserName");
     }
@@ -153,11 +156,6 @@
     {
         messages::createLimitReachedForResource(asyncResp->res);
     }
-    else if (strcmp(errorMessage, "xyz.openbmc_project.User.Common.Error."
-                                  "UserNameGroupFail") == 0)
-    {
-        messages::propertyValueFormatError(asyncResp->res, newUser, "UserName");
-    }
     else
     {
         messages::internalError(asyncResp->res);