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/pcie.hpp b/redfish-core/lib/pcie.hpp
index f2acecc..4ea2dbc 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -129,7 +129,7 @@
nlohmann::json::object_t pcieDevice;
pcieDevice["@odata.id"] = crow::utility::urlFromPieces(
"redfish", "v1", "Systems", "system", "PCIeDevices", devName);
- pcieDeviceList.push_back(std::move(pcieDevice));
+ pcieDeviceList.emplace_back(std::move(pcieDevice));
}
asyncResp->res.jsonValue[name + "@odata.count"] = pcieDeviceList.size();
});
@@ -450,7 +450,7 @@
pcieFunction["@odata.id"] = crow::utility::urlFromPieces(
"redfish", "v1", "Systems", "system", "PCIeDevices", pcieDeviceId,
"PCIeFunctions", std::to_string(functionNum));
- pcieFunctionList.push_back(std::move(pcieFunction));
+ pcieFunctionList.emplace_back(std::move(pcieFunction));
}
res.jsonValue["PCIeFunctions@odata.count"] = pcieFunctionList.size();
}