From: David Majnemer Date: Thu, 13 Nov 2014 07:42:09 +0000 (+0000) Subject: Object, COFF: Cleanup some code in getSectionName X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f7046b7244cd802239d879cc1f406828833624e1;p=oota-llvm.git Object, COFF: Cleanup some code in getSectionName Use StringRef::startswith to tidy up some code, no functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221869 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index 1fdeae6342f..8d8711c7837 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -907,9 +907,9 @@ std::error_code COFFObjectFile::getSectionName(const coff_section *Sec, Name = StringRef(Sec->Name, COFF::NameSize); // Check for string table entry. First byte is '/'. - if (Name[0] == '/') { + if (Name.startswith("/")) { uint32_t Offset; - if (Name[1] == '/') { + if (Name.startswith("//")) { if (decodeBase64StringEntry(Name.substr(2), Offset)) return object_error::parse_failed; } else {