forked from OSchip/llvm-project
Don't create a StringRef from a temporary string.
llvm-svn: 183372
This commit is contained in:
parent
4a8f079371
commit
ea8d370d2a
|
@ -2277,7 +2277,7 @@ HelperSelectorsForTypoCorrection(
|
||||||
StringRef Typo, const ObjCMethodDecl * Method) {
|
StringRef Typo, const ObjCMethodDecl * Method) {
|
||||||
const unsigned MaxEditDistance = 1;
|
const unsigned MaxEditDistance = 1;
|
||||||
unsigned BestEditDistance = MaxEditDistance + 1;
|
unsigned BestEditDistance = MaxEditDistance + 1;
|
||||||
StringRef MethodName = Method->getSelector().getAsString();
|
std::string MethodName = Method->getSelector().getAsString();
|
||||||
|
|
||||||
unsigned MinPossibleEditDistance = abs((int)MethodName.size() - (int)Typo.size());
|
unsigned MinPossibleEditDistance = abs((int)MethodName.size() - (int)Typo.size());
|
||||||
if (MinPossibleEditDistance > 0 &&
|
if (MinPossibleEditDistance > 0 &&
|
||||||
|
|
Loading…
Reference in New Issue