summaryrefslogtreecommitdiff
path: root/include/openbmc_dbus_rest.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 /include/openbmc_dbus_rest.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 'include/openbmc_dbus_rest.hpp')
-rw-r--r--include/openbmc_dbus_rest.hpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index 95503d706e..0e3e070ccd 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -432,7 +432,6 @@ inline void getObjectAndEnumerate(
{
for (const auto& connection : object.second)
{
- std::string& objectManagerPath = connections[connection.first];
for (const auto& interface : connection.second)
{
BMCWEB_LOG_DEBUG << connection.first << " has interface "
@@ -441,7 +440,7 @@ inline void getObjectAndEnumerate(
{
BMCWEB_LOG_DEBUG << "found object manager path "
<< object.first;
- objectManagerPath = object.first;
+ connections[connection.first] = object.first;
}
}
}