writefrudata: add missing constness

Set iterator to const reference where possible.

Change-Id: I2d5d766990d49df3e6a6fef743698053413152fc
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/writefrudata.cpp b/writefrudata.cpp
index cb0d8eb..4fbbf72 100644
--- a/writefrudata.cpp
+++ b/writefrudata.cpp
@@ -82,8 +82,8 @@
     auto first = fruData.cbegin() + minIndexValue;
     auto last = first + (maxIndexValue - minIndexValue) + 1;
 
-    auto itr =
-        std::find_if(first, last, [&key](auto& e) { return key == e.first; });
+    auto itr = std::find_if(first, last,
+                            [&key](const auto& e) { return key == e.first; });
 
     if (itr != last)
     {
@@ -204,15 +204,15 @@
     }
 
     ObjectMap objects;
-    for (auto& instance : instanceList)
+    for (const auto& instance : instanceList)
     {
         InterfaceMap interfaces;
         const auto& extrasIter = extras.find(instance.path);
 
-        for (auto& interfaceList : instance.interfaces)
+        for (const auto& interfaceList : instance.interfaces)
         {
             PropertyMap props; // store all the properties
-            for (auto& properties : interfaceList.second)
+            for (const auto& properties : interfaceList.second)
             {
                 std::string value;
                 decltype(auto) pdata = properties.second;
@@ -595,7 +595,7 @@
     }
 
 #ifdef __IPMI_DEBUG__
-    for (auto& iter : fru_area_vec)
+    for (const auto& iter : fru_area_vec)
     {
         std::printf("FRU ID : [%d]\n", iter->getFruID());
         std::printf("AREA NAME : [%s]\n", iter->getName());