summaryrefslogtreecommitdiff
path: root/redfish-core/lib/health.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-07-01 01:55:45 +0300
committerEd Tanous <ed@tanous.net>2022-12-21 20:15:07 +0300
commitf8fe53e7114ab10c9059377541277739ace5c1ff (patch)
tree368784d5e265e876e05523493cf058c5d24c8240 /redfish-core/lib/health.hpp
parent6dcbb8675d5c5765c3e53354b8f3b339effecd44 (diff)
downloadbmcweb-f8fe53e7114ab10c9059377541277739ace5c1ff.tar.xz
Change variable scopes
cppcheck correctly notes that a lot of our variables can be declared at more specific scopes, and in every case, it seems to be correct. Tested: Redfish service validator passes. Unit test coverage on others. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia4414410d0e8f74a3bd40fdc0e0232450d1a6416
Diffstat (limited to 'redfish-core/lib/health.hpp')
-rw-r--r--redfish-core/lib/health.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp
index 2f0f156ae0..7955fc0d4b 100644
--- a/redfish-core/lib/health.hpp
+++ b/redfish-core/lib/health.hpp
@@ -67,7 +67,6 @@ struct HealthPopulate : std::enable_shared_from_this<HealthPopulate>
for (const auto& [path, interfaces] : statuses)
{
- bool isChild = false;
bool isSelf = false;
if (selfPath)
{
@@ -86,6 +85,7 @@ struct HealthPopulate : std::enable_shared_from_this<HealthPopulate>
// of this association is an inventory item, or one of the
// endpoints in this association is a child
+ bool isChild = false;
for (const std::string& child : inventory)
{
if (path.str.starts_with(child))