[PATCH] D26276: Remove redundant calls to std::string::data()

Malcolm Parsons via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 05:35:43 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL285899: Remove redundant calls to std::string::data() (authored by malcolm.parsons).

Changed prior to commit:
  https://reviews.llvm.org/D26276?vs=76835&id=76846#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26276

Files:
  cfe/trunk/lib/Parse/ParseObjc.cpp
  cfe/trunk/lib/Tooling/Core/Replacement.cpp


Index: cfe/trunk/lib/Tooling/Core/Replacement.cpp
===================================================================
--- cfe/trunk/lib/Tooling/Core/Replacement.cpp
+++ cfe/trunk/lib/Tooling/Core/Replacement.cpp
@@ -569,7 +569,7 @@
     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);
   }
Index: cfe/trunk/lib/Parse/ParseObjc.cpp
===================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp
+++ cfe/trunk/lib/Parse/ParseObjc.cpp
@@ -1036,7 +1036,7 @@
   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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26276.76846.patch
Type: text/x-patch
Size: 1181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161103/1bcc8bba/attachment.bin>


More information about the cfe-commits mailing list