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/update_service.hpp b/redfish-core/lib/update_service.hpp
index c7b1593..d7dfbc4 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -60,7 +60,7 @@
 {
     BMCWEB_LOG_DEBUG << "Activate image for " << objPath << " " << service;
     crow::connections::systemBus->async_method_call(
-        [](const boost::system::error_code errorCode) {
+        [](const boost::system::error_code& errorCode) {
         if (errorCode)
         {
             BMCWEB_LOG_DEBUG << "error_code = " << errorCode;
@@ -135,7 +135,7 @@
                 {
                     std::shared_ptr<task::TaskData> task =
                         task::TaskData::createTask(
-                            [](boost::system::error_code ec,
+                            [](const boost::system::error_code& ec,
                                sdbusplus::message_t& msg,
                                const std::shared_ptr<task::TaskData>&
                                    taskData) {
@@ -506,7 +506,7 @@
 
         // Call TFTP service
         crow::connections::systemBus->async_method_call(
-            [](const boost::system::error_code ec) {
+            [](const boost::system::error_code& ec) {
             if (ec)
             {
                 // messages::internalError(asyncResp->res);
@@ -603,7 +603,7 @@
             *crow::connections::systemBus, "xyz.openbmc_project.Settings",
             "/xyz/openbmc_project/software/apply_time",
             "xyz.openbmc_project.Software.ApplyTime", "RequestedApplyTime",
-            [asyncResp](const boost::system::error_code ec,
+            [asyncResp](const boost::system::error_code& ec,
                         const std::string& applyTime) {
             if (ec)
             {
@@ -689,7 +689,7 @@
 
                     // Set the requested image apply time value
                     crow::connections::systemBus->async_method_call(
-                        [asyncResp](const boost::system::error_code ec) {
+                        [asyncResp](const boost::system::error_code& ec) {
                         if (ec)
                         {
                             BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;
@@ -832,7 +832,7 @@
         *crow::connections::systemBus, service, path,
         "xyz.openbmc_project.Software.Version",
         [asyncResp,
-         swId](const boost::system::error_code errorCode,
+         swId](const boost::system::error_code& errorCode,
                const dbus::utility::DBusPropertiesMap& propertiesList) {
         if (errorCode)
         {