]> granicus.if.org Git - clang/commitdiff
Don't create a StringRef from a temporary string.
authorRichard Trieu <rtrieu@google.com>
Thu, 6 Jun 2013 02:22:29 +0000 (02:22 +0000)
committerRichard Trieu <rtrieu@google.com>
Thu, 6 Jun 2013 02:22:29 +0000 (02:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183372 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclObjC.cpp

index b2387d3c7e162b1e5222d19e5c519582b81718fa..21d66d0497633a07f4450ac729c309255a4ee4d8 100644 (file)
@@ -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 &&