r183372 - Don't create a StringRef from a temporary string.
Richard Trieu
rtrieu at google.com
Wed Jun 5 19:22:29 PDT 2013
Author: rtrieu
Date: Wed Jun 5 21:22:29 2013
New Revision: 183372
URL: http://llvm.org/viewvc/llvm-project?rev=183372&view=rev
Log:
Don't create a StringRef from a temporary string.
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=183372&r1=183371&r2=183372&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Wed Jun 5 21:22:29 2013
@@ -2277,7 +2277,7 @@ HelperSelectorsForTypoCorrection(
StringRef Typo, const ObjCMethodDecl * Method) {
const unsigned 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());
if (MinPossibleEditDistance > 0 &&
More information about the cfe-commits
mailing list