]> granicus.if.org Git - clang/commitdiff
Simplify the last character check.
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 22 Sep 2011 01:35:49 +0000 (01:35 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 22 Sep 2011 01:35:49 +0000 (01:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140287 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PTHLexer.cpp

index 3fd4b55bbdf10c714f06689adc80620c31a2976d..0d48ade39e40b806048edf41ddfe2c48a6724dd1 100644 (file)
@@ -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?