From: David Blaikie Date: Thu, 22 Sep 2011 01:35:49 +0000 (+0000) Subject: Simplify the last character check. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=681d83dd7e36ddb8a25313c446a91c00bbc652dd;p=clang Simplify the last character check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140287 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp index 3fd4b55bbd..0d48ade39e 100644 --- a/lib/Lex/PTHLexer.cpp +++ b/lib/Lex/PTHLexer.cpp @@ -575,7 +575,7 @@ IdentifierInfo* PTHManager::LazilyCreateIdentifierInfo(unsigned PersistentID) { IdentifierInfo* PTHManager::get(StringRef Name) { PTHStringIdLookup& SL = *((PTHStringIdLookup*)StringIdLookup); // Double check our assumption that the last character isn't '\0'. - assert(Name.empty() || Name.data()[Name.size()-1] != '\0'); + assert(Name.empty() || Name.back() != '\0'); PTHStringIdLookup::iterator I = SL.find(std::make_pair(Name.data(), Name.size())); if (I == SL.end()) // No identifier found?