diff options
author | Ed Tanous <ed@tanous.net> | 2024-05-21 04:02:58 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-05-31 23:43:30 +0300 |
commit | 20fa6a2c6cea77a4b411634dfca67eef6c8f430f (patch) | |
tree | 0de9b3c73870f2a7dd45ea6f6807c4c19b16f0cd /include/openbmc_dbus_rest.hpp | |
parent | baddb5971078260665d7685f4132f30cde274cec (diff) | |
download | bmcweb-master.tar.xz |
In the past, we've tried to erradicate the use of
nlohmann::json(initiatlizer_list<...>) because it bloats binary sizes,
as every type is given a new nlohmann constructor.
This commit hunts down the last few places where we call this. There is
still 2 remaining in openbmc_dbus_rest after this, but those are variant
accesses that are difficult to triage, and considering it's a less used
api, they're left as is.
Tested: WIP
Change-Id: Iaac24584bb78bb238da69010b511c1d598bd38bc
Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'include/openbmc_dbus_rest.hpp')
-rw-r--r-- | include/openbmc_dbus_rest.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp index 72e1c31c06..a2f68b4639 100644 --- a/include/openbmc_dbus_rest.hpp +++ b/include/openbmc_dbus_rest.hpp @@ -2332,10 +2332,10 @@ inline void const char* type = arg->Attribute("type"); if (name != nullptr && type != nullptr) { - argsArray.push_back({ - {"name", name}, - {"type", type}, - }); + nlohmann::json::object_t params; + params["name"] = name; + params["type"] = type; + argsArray.push_back(std::move(params)); } arg = arg->NextSiblingElement("arg"); } |