clang-tidy: Enable performance-faster-string-find check
This check optimizes the calls to std::string::find() when the
input passed is a single character string literal. The character
literal overload is more efficient.
Change-Id: I3c95a4214a4e858697c4b40927e0ef990ea86cef
Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
diff --git a/item_updater.cpp b/item_updater.cpp
index 9bbd6c8..f624cbe 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -122,7 +122,7 @@
}
// Version id is the last item in the path
- auto pos = path.rfind("/");
+ auto pos = path.rfind('/');
if (pos == std::string::npos)
{
error("No version id found in object path: {PATH}", "PATH", path);
@@ -850,7 +850,7 @@
{
std::string path = BIOS_OBJPATH;
// Get version id from last item in the path
- auto pos = path.rfind("/");
+ auto pos = path.rfind('/');
if (pos == std::string::npos)
{
error("No version id found in object path {PATH}", "PATH", path);