summaryrefslogtreecommitdiff
path: root/redfish-core/lib/network_protocol.hpp
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2020-10-07 21:41:22 +0300
committerEd Tanous <ed@tanous.net>2020-10-09 20:22:02 +0300
commit3174e4dfd3185c131a07371b4b5a5b40cf0e0bdb (patch)
tree10d3d0cf46070704c775cb2bd2f190575aedd49e /redfish-core/lib/network_protocol.hpp
parentfc76b8ac6c2d9907ffd4618d22753db95c40953d (diff)
downloadbmcweb-3174e4dfd3185c131a07371b4b5a5b40cf0e0bdb.tar.xz
Write the clang-tidy file OpenBMC needs
Now that CI can handle clang-tidy, and a lot of the individual fixes have landed for the various static analysis checks, lets see how close we are. This includes bringing a bunch of the code up to par with the checks that require. Most of them fall into the category of extraneous else statements, const correctness problems, or extra copies. Tested: CI only. Unit tests pass. Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I9fbd346560a75fdd3901fa40c57932486275e912
Diffstat (limited to 'redfish-core/lib/network_protocol.hpp')
-rw-r--r--redfish-core/lib/network_protocol.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index 8ee617f916..8752cf889a 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -265,7 +265,8 @@ class NetworkProtocol : public Node
for (auto& unit : r)
{
/* Only traverse through <xyz>.socket units */
- std::string unitName = std::get<NET_PROTO_UNIT_NAME>(unit);
+ const std::string& unitName =
+ std::get<NET_PROTO_UNIT_NAME>(unit);
if (!boost::ends_with(unitName, ".socket"))
{
continue;
@@ -280,9 +281,9 @@ class NetworkProtocol : public Node
continue;
}
const char* rfServiceKey = kv.first;
- std::string socketPath =
+ const std::string& socketPath =
std::get<NET_PROTO_UNIT_OBJ_PATH>(unit);
- std::string unitState =
+ const std::string& unitState =
std::get<NET_PROTO_UNIT_SUB_STATE>(unit);
asyncResp->res