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/redfish_util.hpp b/redfish-core/lib/redfish_util.hpp
index d7a7f8c..9d358c0 100644
--- a/redfish-core/lib/redfish_util.hpp
+++ b/redfish-core/lib/redfish_util.hpp
@@ -102,7 +102,7 @@
{
crow::connections::systemBus->async_method_call(
[serviceName, callback{std::forward<CallbackFunc>(callback)}](
- const boost::system::error_code ec,
+ const boost::system::error_code& ec,
const std::vector<UnitStruct>& r) {
if (ec)
{
@@ -180,7 +180,7 @@
*crow::connections::systemBus, "org.freedesktop.systemd1", socketPath,
"org.freedesktop.systemd1.Socket", "Listen",
[callback{std::forward<CallbackFunc>(callback)}](
- const boost::system::error_code ec,
+ const boost::system::error_code& ec,
const std::vector<std::tuple<std::string, std::string>>& resp) {
if (ec)
{