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

Malcolm Parsons via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 04:12:52 PDT 2016


malcolm.parsons created this revision.
malcolm.parsons added reviewers: aaron.ballman, mehdi_amini, dblaikie.
malcolm.parsons added a subscriber: cfe-commits.
Herald added a subscriber: klimek.

https://reviews.llvm.org/D26276

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


Index: lib/Tooling/Core/Replacement.cpp
===================================================================
--- lib/Tooling/Core/Replacement.cpp
+++ 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: lib/Parse/ParseObjc.cpp
===================================================================
--- lib/Parse/ParseObjc.cpp
+++ 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.76835.patch
Type: text/x-patch
Size: 1121 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161103/965c04ba/attachment.bin>


More information about the cfe-commits mailing list