https://github.com/tkoeppe created 
https://github.com/llvm/llvm-project/pull/187536

"Effective" is the wrong word: Both overloads are effective; they do what 
they're supposed to do. But the character overload does less work.

From 6e5888613e84824288c0d5b8e5aad51fd7b9ec70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= <[email protected]>
Date: Thu, 19 Mar 2026 16:49:34 +0000
Subject: [PATCH] [clang-tidy] Fix "effective" -> "efficient".

"Effective" is the wrong word: Both overloads are effective; they do what 
they're supposed to do. But the character overload does less work.
---
 .../clang-tidy/performance/FasterStringFindCheck.cpp            | 2 +-
 .../test/clang-tidy/checkers/performance/faster-string-find.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp 
b/clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp
index 1d9325166e341..cd85136baf5ec 100644
--- a/clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp
+++ b/clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp
@@ -88,7 +88,7 @@ void FasterStringFindCheck::check(const 
MatchFinder::MatchResult &Result) {
 
   diag(Literal->getBeginLoc(), "%0 called with a string literal consisting of "
                                "a single character; consider using the more "
-                               "effective overload accepting a character")
+                               "efficient overload accepting a character")
       << FindFunc
       << FixItHint::CreateReplacement(Literal->getSourceRange(), *Replacement);
 }
diff --git 
a/clang-tools-extra/test/clang-tidy/checkers/performance/faster-string-find.cpp 
b/clang-tools-extra/test/clang-tidy/checkers/performance/faster-string-find.cpp
index 3999049a10718..79d6d23f47aa6 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/performance/faster-string-find.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/performance/faster-string-find.cpp
@@ -23,7 +23,7 @@ void StringFind() {
   std::string Str;
 
   Str.find("a");
-  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: 'find' called with a string 
literal consisting of a single character; consider using the more effective 
overload accepting a character [performance-faster-string-find]
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: 'find' called with a string 
literal consisting of a single character; consider using the more efficient 
overload accepting a character [performance-faster-string-find]
   // CHECK-FIXES: Str.find('a');
 
   // Works with the pos argument.

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to