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

llvm-svn: 285899

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

index ecf8ae8..980ea77 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 088b320..ab80c90 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);
   }