Don't create a StringRef from a temporary string.

llvm-svn: 183372
This commit is contained in:
Richard Trieu 2013-06-06 02:22:29 +00:00
parent 4a8f079371
commit ea8d370d2a
1 changed files with 1 additions and 1 deletions

View File

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