diff options
author | Manojkiran Eda <manojkiran.eda@gmail.com> | 2020-09-12 13:01:58 +0300 |
---|---|---|
committer | ManojKiran Eda <manojkiran.eda@gmail.com> | 2020-11-02 06:41:47 +0300 |
commit | 17a897df9fd974e7b7b15fe61c9e59179c7b9fca (patch) | |
tree | 0de904ff7e3fd39e883e19e651bc163f0dd5eac2 /redfish-core/lib/certificate_service.hpp | |
parent | 313efb1c9afcb0192585579a663467c28f873286 (diff) | |
download | bmcweb-17a897df9fd974e7b7b15fe61c9e59179c7b9fca.tar.xz |
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
Diffstat (limited to 'redfish-core/lib/certificate_service.hpp')
-rw-r--r-- | redfish-core/lib/certificate_service.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp index 5dc1e1ffbb..81d9d0584f 100644 --- a/redfish-core/lib/certificate_service.hpp +++ b/redfish-core/lib/certificate_service.hpp @@ -516,7 +516,7 @@ static void updateCertIssuerOrSubject(nlohmann::json& out, std::string_view::iterator tokenBegin = i; while (i != value.end() && *i != '=') { - i++; + ++i; } if (i == value.end()) { @@ -524,11 +524,11 @@ static void updateCertIssuerOrSubject(nlohmann::json& out, } const std::string_view key(tokenBegin, static_cast<size_t>(i - tokenBegin)); - i++; + ++i; tokenBegin = i; while (i != value.end() && *i != ',') { - i++; + ++i; } const std::string_view val(tokenBegin, static_cast<size_t>(i - tokenBegin)); @@ -559,7 +559,7 @@ static void updateCertIssuerOrSubject(nlohmann::json& out, // skip comma character if (i != value.end()) { - i++; + ++i; } } } |