summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-10-23 19:51:10 -0700
committerPatrick Venture <venture@google.com>2018-11-07 20:03:29 +0000
commit438fb7957f4b763ba28b13ef36732b40e77bb226 (patch)
tree3aff2c2d906e0bfdbee6de60fd223dc19fa404c1
parentb0431c79872ad7d9ca9fcf543a769ef233f8c94c (diff)
downloadphosphor-host-ipmid-438fb7957f4b763ba28b13ef36732b40e77bb226.tar.gz
phosphor-host-ipmid-438fb7957f4b763ba28b13ef36732b40e77bb226.zip
read_fru_data: use structured bindings in fru loop
Use structured bindings for first/second in fru loop. Change-Id: Ief5460946ead910ccae653ebb6f9d894805b756d Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--read_fru_data.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/read_fru_data.cpp b/read_fru_data.cpp
index 4723308..44ea11c 100644
--- a/read_fru_data.cpp
+++ b/read_fru_data.cpp
@@ -81,18 +81,14 @@ void processFruPropChange(sdbusplus::message::message& msg)
{
path.erase(0, strlen(OBJ_PATH));
}
- for (auto& fru : frus)
+ for (const auto& [fruId, instanceList] : frus)
{
- auto& instanceList = fru.second;
-
auto found = std::find_if(
instanceList.begin(), instanceList.end(),
[&path](const auto& iter) { return (iter.path == path); });
if (found != instanceList.end())
{
- auto& fruId = fru.first;
-
cache::fruMap.erase(fruId);
break;
}
OpenPOWER on IntegriCloud