fix more push vs emplace calls
It seems like clang-tidy doesn't catch every place that an emplace could
be used instead of a push. Use a few grep/sed pairs to find and fix up
some common patterns.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I93eaec26b8e3be240599e92b66cf54947073dc4c
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index c9d4eb8..8a68aae 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -404,7 +404,7 @@
nlohmann::json::object_t roleMapEntry;
roleMapEntry["LocalRole"] = *localRole;
roleMapEntry["RemoteGroup"] = *remoteGroup;
- remoteRoleJson.push_back(std::move(roleMapEntry));
+ remoteRoleJson.emplace_back(std::move(roleMapEntry));
},
ldapDbusService, dbusObjectPath, ldapPrivMapperInterface,
"Create", *remoteGroup,
@@ -1585,7 +1585,7 @@
nlohmann::json::object_t member;
member["@odata.id"] = "/redfish/v1/AccountService/Accounts/" +
user;
- memberArray.push_back(std::move(member));
+ memberArray.emplace_back(std::move(member));
}
}
asyncResp->res.jsonValue["Members@odata.count"] = memberArray.size();