diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-10-24 21:37:51 +0300 |
---|---|---|
committer | James Feist <james.feist@linux.intel.com> | 2019-10-29 23:50:35 +0300 |
commit | 0f0353b66d52a3060db99495170473c5f98611ec (patch) | |
tree | da66608099135618ff6430570df0dd0415c89451 | |
parent | adbe192a68306d403c2546dbc8ebf98ae5a99d7b (diff) | |
download | bmcweb-0f0353b66d52a3060db99495170473c5f98611ec.tar.xz |
Modernize: use emplace instead of push_back
We had a couple uses of push_back in the code that could be made more
efficient with emplace(). Use them instead.
Tested: No functional change. Needs tested.
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Change-Id: I417601e416b1d0be989617a372978d52670135d8
-rw-r--r-- | include/openbmc_dbus_rest.hpp | 6 | ||||
-rw-r--r-- | redfish-core/lib/account_service.hpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp index a4cccb167b..c8673d19a9 100644 --- a/include/openbmc_dbus_rest.hpp +++ b/include/openbmc_dbus_rest.hpp @@ -466,7 +466,7 @@ std::vector<std::string> dbusArgSplit(const std::string &string) { return ret; } - ret.push_back(""); + ret.emplace_back(""); int containerDepth = 0; for (std::string::const_iterator character = string.begin(); @@ -488,7 +488,7 @@ std::vector<std::string> dbusArgSplit(const std::string &string) { if (character + 1 != string.end()) { - ret.push_back(""); + ret.emplace_back(""); } } break; @@ -497,7 +497,7 @@ std::vector<std::string> dbusArgSplit(const std::string &string) { if (character + 1 != string.end()) { - ret.push_back(""); + ret.emplace_back(""); } } break; diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp index 7f34949fae..07efeb5b39 100644 --- a/redfish-core/lib/account_service.hpp +++ b/redfish-core/lib/account_service.hpp @@ -488,8 +488,8 @@ inline void getLDAPConfigData(const std::string& ldapType, } } - confData.groupRoleList.push_back(std::make_pair( - object.first.str, roleMapData)); + confData.groupRoleList.emplace_back( + object.first.str, roleMapData); } } } |