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
diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
index f6a56f6..a921dcb 100644
--- a/redfish-core/lib/virtual_media.hpp
+++ b/redfish-core/lib/virtual_media.hpp
@@ -160,7 +160,7 @@
nlohmann::json item;
const std::string& path =
static_cast<const std::string&>(object.first);
- std::size_t lastIndex = path.rfind("/");
+ std::size_t lastIndex = path.rfind('/');
if (lastIndex == std::string::npos)
{
continue;
@@ -203,7 +203,7 @@
const std::string& path =
static_cast<const std::string&>(item.first);
- std::size_t lastItem = path.rfind("/");
+ std::size_t lastItem = path.rfind('/');
if (lastItem == std::string::npos)
{
continue;
@@ -521,7 +521,7 @@
const std::string& path =
static_cast<const std::string&>(object.first);
- std::size_t lastIndex = path.rfind("/");
+ std::size_t lastIndex = path.rfind('/');
if (lastIndex == std::string::npos)
{
continue;
@@ -903,7 +903,7 @@
const std::string& path =
static_cast<const std::string&>(object.first);
- std::size_t lastIndex = path.rfind("/");
+ std::size_t lastIndex = path.rfind('/');
if (lastIndex == std::string::npos)
{
continue;