Using llvm::sys::swapByteOrder() for the common case of byte-swapping a value in place

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210978 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Artyom Skrobov
2014-06-14 13:18:07 +00:00
parent 25e659b6ff
commit ab22d95481
5 changed files with 8 additions and 8 deletions

View File

@@ -21,7 +21,7 @@ static T getU(uint32_t *offset_ptr, const DataExtractor *de,
if (de->isValidOffsetForDataOfSize(offset, sizeof(val))) {
std::memcpy(&val, &Data[offset], sizeof(val));
if (sys::IsLittleEndianHost != isLittleEndian)
val = sys::getSwappedBytes(val);
sys::swapByteOrder(val);
// Advance the offset
*offset_ptr += sizeof(val);