r285899 - Remove redundant calls to std::string::data()
Malcolm Parsons via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 3 05:25:52 PDT 2016
Author: malcolm.parsons
Date: Thu Nov 3 07:25:51 2016
New Revision: 285899
URL: http://llvm.org/viewvc/llvm-project?rev=285899&view=rev
Log:
Remove redundant calls to std::string::data()
Reviewers: aaron.ballman, mehdi_amini, dblaikie
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D26276
Modified:
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/lib/Tooling/Core/Replacement.cpp
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=285899&r1=285898&r2=285899&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Thu Nov 3 07:25:51 2016
@@ -1036,7 +1036,7 @@ IdentifierInfo *Parser::ParseObjCSelecto
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;
Modified: cfe/trunk/lib/Tooling/Core/Replacement.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Core/Replacement.cpp?rev=285899&r1=285898&r2=285899&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Core/Replacement.cpp (original)
+++ cfe/trunk/lib/Tooling/Core/Replacement.cpp Thu Nov 3 07:25:51 2016
@@ -569,7 +569,7 @@ std::map<std::string, Replacements> grou
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);
}
More information about the cfe-commits
mailing list