From 2314b3defa325bab5b919e15ace61fecd6000a57 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 13 Nov 2014 07:42:09 +0000 Subject: [PATCH] Object, COFF: Cleanup some code in getSectionName Use StringRef::startswith to tidy up some code, no functionality change intended. llvm-svn: 221869 --- llvm/lib/Object/COFFObjectFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp index 1fdeae6342f2..8d8711c7837b 100644 --- a/llvm/lib/Object/COFFObjectFile.cpp +++ b/llvm/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 {