]> granicus.if.org Git - clang/commitdiff
Remove redundant calls to std::string::data()
authorMalcolm Parsons <malcolm.parsons@gmail.com>
Thu, 3 Nov 2016 12:25:51 +0000 (12:25 +0000)
committerMalcolm Parsons <malcolm.parsons@gmail.com>
Thu, 3 Nov 2016 12:25:51 +0000 (12:25 +0000)
Reviewers: aaron.ballman, mehdi_amini, dblaikie

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D26276

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

lib/Parse/ParseObjc.cpp
lib/Tooling/Core/Replacement.cpp

index ecf8ae8dffce99bd3a41f53e3c0f8cb3935835b1..980ea77d84a40c2c749dbbbdd0af5c7fb80c3315 100644 (file)
@@ -1036,7 +1036,7 @@ IdentifierInfo *Parser::ParseObjCSelectorPiece(SourceLocation &SelectorLoc) {
   case tok::caretequal: {
     std::string ThisTok(PP.getSpelling(Tok));
     if (isLetter(ThisTok[0])) {
-      IdentifierInfo *II = &PP.getIdentifierTable().get(ThisTok.data());
+      IdentifierInfo *II = &PP.getIdentifierTable().get(ThisTok);
       Tok.setKind(tok::identifier);
       SelectorLoc = ConsumeToken();
       return II;
index 088b320916a819441a94f601c66bfa491b6de37b..ab80c90e52fe9d25498e4c5469d59b05f98a8425 100644 (file)
@@ -569,7 +569,7 @@ std::map<std::string, Replacements> groupReplacementsByFile(
     const std::map<std::string, Replacements> &FileToReplaces) {
   std::map<std::string, Replacements> Result;
   for (const auto &Entry : FileToReplaces) {
-    llvm::SmallString<256> CleanPath(Entry.first.data());
+    llvm::SmallString<256> CleanPath(Entry.first);
     llvm::sys::path::remove_dots(CleanPath, /*remove_dot_dot=*/true);
     Result[CleanPath.str()] = std::move(Entry.second);
   }