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
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index a4cccb1..c8673d1 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -466,7 +466,7 @@
{
return ret;
}
- ret.push_back("");
+ ret.emplace_back("");
int containerDepth = 0;
for (std::string::const_iterator character = string.begin();
@@ -488,7 +488,7 @@
{
if (character + 1 != string.end())
{
- ret.push_back("");
+ ret.emplace_back("");
}
}
break;
@@ -497,7 +497,7 @@
{
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 7f34949..07efeb5 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -488,8 +488,8 @@
}
}
- confData.groupRoleList.push_back(std::make_pair(
- object.first.str, roleMapData));
+ confData.groupRoleList.emplace_back(
+ object.first.str, roleMapData);
}
}
}