Improve loops & fix cpp check warning
- This commit improves certain while loops to range based for loops.
- This commit also fixes the cppcheck warning that mentions about
performance issues when using postfix operators on non-primitive
types.
Tested By:
- A function is unittested.
- GET on both EthernetInterfaces & certificate service
looks good without any issues.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I85420f7bf9af45a97e1a93b916f292c2516f5802
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index 26c2125..c621de3 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -1520,7 +1520,7 @@
std::string& type = containerPair.first;
for (nlohmann::json::iterator it = container->begin();
- it != container->end(); it++)
+ it != container->end(); ++it)
{
const auto& name = it.key();
BMCWEB_LOG_DEBUG << "looking for " << name;