[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:
parent
4b17135d14
commit
4376bf27c1
@ -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);
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user