summaryrefslogtreecommitdiff
path: root/redfish-core/lib/update_service.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/update_service.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/update_service.hpp')
-rw-r--r--redfish-core/lib/update_service.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index 7e6a0b807f..a247ad0d67 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -415,7 +415,7 @@ class UpdateServiceActionsSimpleUpdate : public Node
{
// Must be option 2
// Verify ImageURI has transfer protocol in it
- size_t separator = imageURI.find(":");
+ size_t separator = imageURI.find(':');
if ((separator == std::string::npos) ||
((separator + 1) > imageURI.size()))
{
@@ -451,7 +451,7 @@ class UpdateServiceActionsSimpleUpdate : public Node
}
// Format should be <IP or Hostname>/<file> for imageURI
- size_t separator = imageURI.find("/");
+ size_t separator = imageURI.find('/');
if ((separator == std::string::npos) ||
((separator + 1) > imageURI.size()))
{
@@ -726,7 +726,7 @@ class SoftwareInventoryCollection : public Node
{
// if can't parse fw id then return
std::size_t idPos;
- if ((idPos = obj.first.rfind("/")) == std::string::npos)
+ if ((idPos = obj.first.rfind('/')) == std::string::npos)
{
messages::internalError(asyncResp->res);
BMCWEB_LOG_DEBUG << "Can't parse firmware ID!!";
@@ -913,7 +913,7 @@ class SoftwareInventory : public Node
// swInvPurpose is of format:
// xyz.openbmc_project.Software.Version.VersionPurpose.ABC
// Translate this to "ABC image"
- size_t endDesc = swInvPurpose->rfind(".");
+ size_t endDesc = swInvPurpose->rfind('.');
if (endDesc == std::string::npos)
{
messages::internalError(asyncResp->res);