From 1476687deb1697d865b20458a0097c9ab5fd44e2 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Tue, 15 Mar 2022 10:44:42 -0700 Subject: Remove brace initialization of json objects Brace initialization of json objects, while quite interesting from an academic sense, are very difficult for people to grok, and lead to inconsistencies. This patchset aims to remove a majority of them in lieu of operator[]. Interestingly, this saves about 1% of the binary size of bmcweb. This also has an added benefit that as a design pattern, we're never constructing a new object, then moving it into place, we're always adding to the existing object, which in the future _could_ make things like OEM schemas or properties easier, as there's no case where we're completely replacing the response object. Tested: Ran redfish service validator. No new failures. Signed-off-by: Ed Tanous Change-Id: Iae409b0a40ddd3ae6112cb2d52c6f6ab388595fe --- include/ibm/management_console_rest.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/ibm') diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp index 8e307464ca..0fbd2e22c1 100644 --- a/include/ibm/management_console_rest.hpp +++ b/include/ibm/management_console_rest.hpp @@ -690,12 +690,12 @@ inline void requestRoutes(App& app) asyncResp->res.jsonValue["@odata.id"] = "/ibm/v1/"; asyncResp->res.jsonValue["Id"] = "IBM Rest RootService"; asyncResp->res.jsonValue["Name"] = "IBM Service Root"; - asyncResp->res.jsonValue["ConfigFiles"] = { - {"@odata.id", "/ibm/v1/Host/ConfigFiles"}}; - asyncResp->res.jsonValue["LockService"] = { - {"@odata.id", "/ibm/v1/HMC/LockService"}}; - asyncResp->res.jsonValue["BroadcastService"] = { - {"@odata.id", "/ibm/v1/HMC/BroadcastService"}}; + asyncResp->res.jsonValue["ConfigFiles"]["@odata.id"] = + "/ibm/v1/Host/ConfigFiles"; + asyncResp->res.jsonValue["LockService"]["@odata.id"] = + "/ibm/v1/HMC/LockService"; + asyncResp->res.jsonValue["BroadcastService"]["@odata.id"] = + "/ibm/v1/HMC/BroadcastService"; }); BMCWEB_ROUTE(app, "/ibm/v1/Host/ConfigFiles") -- cgit v1.2.3