summaryrefslogtreecommitdiff
path: root/redfish-core/lib/network_protocol.hpp
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2020-10-15 19:41:17 +0300
committerEd Tanous <ed@tanous.net>2020-10-23 18:29:24 +0300
commitf23b729676559f539790580930b1ff3b0c05805b (patch)
treec068573cefdfd5e6dff266fc6a9c1e530af9b491 /redfish-core/lib/network_protocol.hpp
parent04e438cbad66838724d78ce12f28aff1fb892a63 (diff)
downloadbmcweb-f23b729676559f539790580930b1ff3b0c05805b.tar.xz
Turn on ALL perf checks
1st, alphabetize the tidy-list for good housekeeping. Next, enable all the clang-tidy performance checks, and resolve all the issues. most of the issues boil down to: 1. Using std::move on const variables. This does nothing. 2. Passing big variables (like std::string) by value. 3. Using double quotes on a find call, which constructs an intermediate string, rather than using the character overload. Tested Loaded on system, logged in successfully and pulled down webui-vue. No new errors. Walked the Redfish tree a bit, and observed no new problems. Ran redfish service validator. Got no new failures (although there are a lot of log service deprecation warnings that we should look at). Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I2238958c4b22c1e554e09a0a1787c744bdbca43e
Diffstat (limited to 'redfish-core/lib/network_protocol.hpp')
-rw-r--r--redfish-core/lib/network_protocol.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index 8752cf889a..31efc7552e 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -82,7 +82,7 @@ inline void
&propertyPair.second);
if (ntpServers != nullptr)
{
- ntpData = std::move(*ntpServers);
+ ntpData = *ntpServers;
}
}
else if (propertyPair.first == "DomainName")
@@ -92,7 +92,7 @@ inline void
&propertyPair.second);
if (domainNames != nullptr)
{
- dnData = std::move(*domainNames);
+ dnData = *domainNames;
}
}
}
@@ -240,10 +240,11 @@ class NetworkProtocol : public Node
asyncResp->res.jsonValue["NTP"]["NTPServers"] = ntpServers;
if (hostName.empty() == false)
{
- std::string fqdn = std::move(hostName);
+ std::string fqdn = hostName;
if (domainNames.empty() == false)
{
- fqdn += "." + domainNames[0];
+ fqdn += ".";
+ fqdn += domainNames[0];
}
asyncResp->res.jsonValue["FQDN"] = std::move(fqdn);
}
@@ -317,7 +318,7 @@ class NetworkProtocol : public Node
std::get<NET_PROTO_LISTEN_STREAM>(
(*responsePtr)[0]);
std::size_t lastColonPos =
- listenStream.rfind(":");
+ listenStream.rfind(':');
if (lastColonPos == std::string::npos)
{
// Not a port