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/power.hpp b/redfish-core/lib/power.hpp
index 116ea25..7dbf660 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -79,7 +79,7 @@
             *crow::connections::systemBus, "xyz.openbmc_project.Settings",
             "/xyz/openbmc_project/control/host0/power_cap",
             "xyz.openbmc_project.Control.Power.Cap", "PowerCapEnable",
-            [value, sensorsAsyncResp](const boost::system::error_code ec,
+            [value, sensorsAsyncResp](const boost::system::error_code& ec,
                                       bool powerCapEnable) {
             if (ec)
             {
@@ -98,7 +98,7 @@
             }
 
             crow::connections::systemBus->async_method_call(
-                [sensorsAsyncResp](const boost::system::error_code ec2) {
+                [sensorsAsyncResp](const boost::system::error_code& ec2) {
                 if (ec2)
                 {
                     BMCWEB_LOG_DEBUG << "Power Limit Set: Dbus error: " << ec2;
@@ -196,7 +196,7 @@
 
             auto valueHandler =
                 [sensorAsyncResp](
-                    const boost::system::error_code ec,
+                    const boost::system::error_code& ec,
                     const dbus::utility::DBusPropertiesMap& properties) {
                 if (ec)
                 {