diff options
author | Nan Zhou <nanzhoumails@gmail.com> | 2022-06-03 02:57:38 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-06-19 07:08:04 +0300 |
commit | b2ec0ce5a7624b00e0eff5f08c2c51d18592bcf9 (patch) | |
tree | 2e9e750f876d5a88432058f523e3c118a3d92603 /include/openbmc_dbus_rest.hpp | |
parent | b66cf2a2f10aab3bd21e8be60b7fb0894d342c05 (diff) | |
download | bmcweb-b2ec0ce5a7624b00e0eff5f08c2c51d18592bcf9.tar.xz |
openbmc_dbus_rest: use auto for json iterators
Clang++ complains about
```
error: use of overloaded operator '==' is ambiguous
(with operand types 'nlohmann::json::const_iterator'
(aka 'iter_impl<const nlohmann::basic_json<>>') and
'nlohmann::basic_json<>::iterator'
(aka 'iter_impl<nlohmann::basic_json<>>'))
if (argIt == transaction->arguments.end())
```
Considering we often use auto for iterators, I changed all explict JSON
iterator types in this file to auto.
Tested:
1. compies on clang;
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I053de0618491dcb01ff8d4e25fe1ebe3c2d3c105
Diffstat (limited to 'include/openbmc_dbus_rest.hpp')
-rw-r--r-- | include/openbmc_dbus_rest.hpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp index 9e79e60ccd..1ed695ac19 100644 --- a/include/openbmc_dbus_rest.hpp +++ b/include/openbmc_dbus_rest.hpp @@ -1425,8 +1425,7 @@ inline void findActionOnInterface( argumentNode->NextSiblingElement("arg"); } - nlohmann::json::const_iterator argIt = - transaction->arguments.begin(); + auto argIt = transaction->arguments.begin(); argumentNode = methodNode->FirstChildElement("arg"); @@ -1836,7 +1835,7 @@ inline void handlePut(const crow::Request& req, return; } - nlohmann::json::const_iterator propertyIt = requestDbusData.find("data"); + auto propertyIt = requestDbusData.find("data"); if (propertyIt == requestDbusData.end()) { setErrorResponse(asyncResp->res, |