clang-tidy: Enable readability-string-compare check
Finds string comparisons using the compare method.
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I78c904bca4724e84aa3999d9f34ed66b567af984
diff --git a/.clang-tidy b/.clang-tidy
index c10e753..dd69f53 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -271,6 +271,7 @@
readability-redundant-string-init,
readability-simplify-subscript-expr,
readability-static-definition-in-anonymous-namespace,
+readability-string-compare,
readability-suspicious-call-argument,
readability-uniqueptr-delete-release,
readability-uppercase-literal-suffix'
diff --git a/fault-monitor/fru-fault-monitor.cpp b/fault-monitor/fru-fault-monitor.cpp
index cf64862..e67ffb4 100644
--- a/fault-monitor/fru-fault-monitor.cpp
+++ b/fault-monitor/fru-fault-monitor.cpp
@@ -167,7 +167,7 @@
for (const auto& item : assocs)
{
- if (std::get<1>(item).compare(CALLOUT_REV_ASSOCIATION) == 0)
+ if (std::get<1>(item) == CALLOUT_REV_ASSOCIATION)
{
removeWatches.emplace_back(
std::make_unique<Remove>(bus, std::get<2>(item)));
@@ -242,7 +242,7 @@
for (const auto& item : assocs)
{
- if (std::get<1>(item).compare(CALLOUT_REV_ASSOCIATION) == 0)
+ if (std::get<1>(item) == CALLOUT_REV_ASSOCIATION)
{
removeWatches.emplace_back(
std::make_unique<Remove>(bus, std::get<2>(item)));