[cfe-commits] r140287 - /cfe/trunk/lib/Lex/PTHLexer.cpp
David Blaikie
dblaikie at gmail.com
Wed Sep 21 18:35:49 PDT 2011
Author: dblaikie
Date: Wed Sep 21 20:35:49 2011
New Revision: 140287
URL: http://llvm.org/viewvc/llvm-project?rev=140287&view=rev
Log:
Simplify the last character check.
Modified:
cfe/trunk/lib/Lex/PTHLexer.cpp
Modified: cfe/trunk/lib/Lex/PTHLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PTHLexer.cpp?rev=140287&r1=140286&r2=140287&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PTHLexer.cpp (original)
+++ cfe/trunk/lib/Lex/PTHLexer.cpp Wed Sep 21 20:35:49 2011
@@ -575,7 +575,7 @@
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?
More information about the cfe-commits
mailing list