diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2023-05-12 18:18:43 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2023-05-12 18:19:12 +0300 |
commit | 840a9ffcb1a9d609919e07d0ebf5887576af240f (patch) | |
tree | d06442fbbcb5652914c34060bdb2c21227b8cc01 | |
parent | a232343d8c1ff05ac9fdb55f3ec299b42d6b6929 (diff) | |
download | bmcweb-840a9ffcb1a9d609919e07d0ebf5887576af240f.tar.xz |
chassis: fix clang-tidy warning
```
/data0/jenkins/workspace/ci-repository/openbmc/bmcweb/redfish-core/lib/chassis.hpp:130:13: error: loop will run at most once (loop increment never executed) [clang-diagnostic-unreachable-code-loop-increment,-warnings-as-errors]
for (const auto& service : object.second)
```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I3d7743115ec31d6f704a857f3e878fa1b7728a60
-rw-r--r-- | redfish-core/lib/chassis.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp index 31b38c315f..c64d27c335 100644 --- a/redfish-core/lib/chassis.hpp +++ b/redfish-core/lib/chassis.hpp @@ -127,8 +127,9 @@ inline void getPhysicalSecurityData(std::shared_ptr<bmcweb::AsyncResp> aResp) // Iterate over all retrieved ObjectPaths. for (const auto& object : subtree) { - for (const auto& service : object.second) + if (!object.second.empty()) { + const auto service = object.second.front(); getIntrusionByService(aResp, service.first, object.first); return; } |