From: Richard Trieu Date: Thu, 6 Jun 2013 02:22:29 +0000 (+0000) Subject: Don't create a StringRef from a temporary string. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4fe9644dc3533e4517f980645957c6fc9408c6f6;p=clang Don't create a StringRef from a temporary string. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183372 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index b2387d3c7e..21d66d0497 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -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 &&