Skip to content

Commit

Permalink
Object, COFF: Cleanup some code in getSectionName
Browse files Browse the repository at this point in the history
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
  • Loading branch information
majnemer committed Nov 13, 2014
1 parent 465237b commit f7046b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Object/COFFObjectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f7046b7

Please sign in to comment.