Take boost error_code by reference
By convention, we should be following boost here, and passing error_code
by reference, not by value. This makes our code consistent, and removes
the need for a copy in some cases.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Id42ea4a90b6685a84818b87d1506c11256b3b9ae
diff --git a/redfish-core/lib/pcie_slots.hpp b/redfish-core/lib/pcie_slots.hpp
index 70efa13..42c8bb1 100644
--- a/redfish-core/lib/pcie_slots.hpp
+++ b/redfish-core/lib/pcie_slots.hpp
@@ -71,7 +71,7 @@
inline void
onPcieSlotGetAllDone(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const boost::system::error_code ec,
+ const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& propertiesList)
{
if (ec)
@@ -150,7 +150,7 @@
inline void onMapperAssociationDone(
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& chassisID, const std::string& pcieSlotPath,
- const std::string& connectionName, const boost::system::error_code ec,
+ const std::string& connectionName, const boost::system::error_code& ec,
const std::variant<std::vector<std::string>>& endpoints)
{
if (ec)
@@ -193,7 +193,7 @@
sdbusplus::asio::getAllProperties(
*crow::connections::systemBus, connectionName, pcieSlotPath,
"xyz.openbmc_project.Inventory.Item.PCIeSlot",
- [asyncResp](const boost::system::error_code ec2,
+ [asyncResp](const boost::system::error_code& ec2,
const dbus::utility::DBusPropertiesMap& propertiesList) {
onPcieSlotGetAllDone(asyncResp, ec2, propertiesList);
});
@@ -202,7 +202,7 @@
inline void
onMapperSubtreeDone(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& chassisID,
- const boost::system::error_code ec,
+ const boost::system::error_code& ec,
const dbus::utility::MapperGetSubTreeResponse& subtree)
{
if (ec)