[clang-tidy] Fix "effective" -> "efficient". (#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.
This commit is contained in:
Thomas Köppe 2026-03-20 09:29:54 +00:00 committed by GitHub
parent 4b17135d14
commit 4376bf27c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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.