clang-tidy: Enable readability-string-compare check
This check finds string comparisons using the compare method.
A common mistake is to use the string’s compare method instead of
using the equality or inequality operators.
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I9d4b8aad27fa34345d08d2ba326b8a31cd3d99c6
diff --git a/src/item_updater.cpp b/src/item_updater.cpp
index 254b18f..4213f78 100644
--- a/src/item_updater.cpp
+++ b/src/item_updater.cpp
@@ -174,7 +174,7 @@
{
for (auto iter = assocs.begin(); iter != assocs.end();)
{
- if ((std::get<2>(*iter)).compare(path) == 0)
+ if ((std::get<2>(*iter)) == path)
{
iter = assocs.erase(iter);
associations(assocs);
@@ -274,7 +274,7 @@
auto associations = activationPtr->associations();
for (auto iter = associations.begin(); iter != associations.end();)
{
- if ((std::get<2>(*iter)).compare(psuInventoryPath) == 0)
+ if ((std::get<2>(*iter)) == psuInventoryPath)
{
iter = associations.erase(iter);
}