[llvm] r221869 - Object, COFF: Cleanup some code in getSectionName
David Majnemer
david.majnemer at gmail.com
Wed Nov 12 23:42:09 PST 2014
Author: majnemer
Date: Thu Nov 13 01:42:09 2014
New Revision: 221869
URL: http://llvm.org/viewvc/llvm-project?rev=221869&view=rev
Log:
Object, COFF: Cleanup some code in getSectionName
Use StringRef::startswith to tidy up some code, no functionality change
intended.
Modified:
llvm/trunk/lib/Object/COFFObjectFile.cpp
Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=221869&r1=221868&r2=221869&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Thu Nov 13 01:42:09 2014
@@ -907,9 +907,9 @@ std::error_code COFFObjectFile::getSecti
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 {
More information about the llvm-commits
mailing list