From 0f0353b66d52a3060db99495170473c5f98611ec Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Thu, 24 Oct 2019 11:37:51 -0700 Subject: 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 Change-Id: I417601e416b1d0be989617a372978d52670135d8 --- include/openbmc_dbus_rest.hpp | 6 +++--- 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 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 dbusArgSplit(const std::string &string) { if (character + 1 != string.end()) { - ret.push_back(""); + ret.emplace_back(""); } } break; @@ -497,7 +497,7 @@ std::vector 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); } } } -- cgit v1.2.3