]> granicus.if.org Git - clang/commitdiff
Minor speed tweak per Chris's suggestion: use &S[0] instead of S.c_str().
authorTed Kremenek <kremenek@apple.com>
Wed, 19 Mar 2008 16:32:34 +0000 (16:32 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 19 Mar 2008 16:32:34 +0000 (16:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48544 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Rewrite/Rewriter.h

index d4cba6af0abb751b59a3a3ab626ae977c3a085a3..56befec7e89b9d213bf9bf3a44352c5f6f0c14a1 100644 (file)
@@ -184,11 +184,11 @@ public:
   }
   
   bool InsertStrBefore(SourceLocation Loc, const std::string& S) {
-    return S.empty() ? false : InsertTextBefore(Loc, S.c_str(), S.size());
+    return S.empty() ? false : InsertTextBefore(Loc, &S[0], S.size());
   }
 
   bool InsertStrAfter(SourceLocation Loc, const std::string& S) {
-    return S.empty() ? false : InsertTextAfter(Loc, S.c_str(), S.size());
+    return S.empty() ? false : InsertTextAfter(Loc, &S[0], S.size());
   }