diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp index 27855bf92b871f..54a2a61c318755 100644 --- a/llvm/lib/ProfileData/InstrProfReader.cpp +++ b/llvm/lib/ProfileData/InstrProfReader.cpp @@ -113,12 +113,7 @@ readBinaryIdsInternal(const MemoryBuffer &DataBuffer, instrprof_error::malformed, "not enough data to read binary id length"); - uint64_t BILen = 0; - if (Endian == llvm::endianness::little) - BILen = endian::readNext(BI); - else - BILen = endian::readNext(BI); - + uint64_t BILen = endian::readNext(BI, Endian); if (BILen == 0) return make_error(instrprof_error::malformed, "binary id length is 0");