]> granicus.if.org Git - clang/commitdiff
Avoid a local Twine variable.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 29 Mar 2014 16:54:24 +0000 (16:54 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 29 Mar 2014 16:54:24 +0000 (16:54 +0000)
Harmless in this case but potentially dangerous if it gets extended some day.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205107 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Edit/EditedSource.cpp

index 34b5e62333adc7ed8e89a2fbd43bcdcab42b6c96..8fa2ee57d2cc15a20592112781a6f65115cce52c 100644 (file)
@@ -72,13 +72,11 @@ bool EditedSource::commitInsert(SourceLocation OrigLoc,
     return true;
   }
 
-  Twine concat;
   if (beforePreviousInsertions)
-    concat = Twine(text) + FA.Text;
+    FA.Text = copyString(Twine(text) + FA.Text);
   else
-    concat = Twine(FA.Text) +  text;
+    FA.Text = copyString(Twine(FA.Text) + text);
 
-  FA.Text = copyString(concat);
   return true;
 }