From: Malcolm Parsons Date: Thu, 3 Nov 2016 12:25:51 +0000 (+0000) Subject: Remove redundant calls to std::string::data() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47592b1815f5423fa708fca47741886043e6bb32;p=clang Remove redundant calls to std::string::data() 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 --- diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index ecf8ae8dff..980ea77d84 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -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; diff --git a/lib/Tooling/Core/Replacement.cpp b/lib/Tooling/Core/Replacement.cpp index 088b320916..ab80c90e52 100644 --- a/lib/Tooling/Core/Replacement.cpp +++ b/lib/Tooling/Core/Replacement.cpp @@ -569,7 +569,7 @@ std::map groupReplacementsByFile( const std::map &FileToReplaces) { std::map 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); }