Object: Small cleanup in COFFObjectFile::getSymbol

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217648 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2014-09-11 23:42:10 +00:00
parent a476ce78a0
commit ddf2ec4d4b

View File

@ -569,10 +569,10 @@ public:
template <typename coff_symbol_type>
std::error_code getSymbol(uint32_t Index,
const coff_symbol_type *&Res) const {
if (Index < getNumberOfSymbols())
Res = reinterpret_cast<coff_symbol_type *>(getSymbolTable()) + Index;
else
if (Index >= getNumberOfSymbols())
return object_error::parse_failed;
Res = reinterpret_cast<coff_symbol_type *>(getSymbolTable()) + Index;
return object_error::success;
}
ErrorOr<COFFSymbolRef> getSymbol(uint32_t index) const {