optimise endian
This commit is contained in:
@@ -17,9 +17,9 @@ void SwapBytes(T& value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsSystemBigEndian() {
|
bool IsSystemBigEndian() {
|
||||||
std::uint16_t test = 0;
|
static constexpr std::uint16_t test = 10;
|
||||||
reinterpret_cast<std::uint8_t*>(&test)[1] = 1;
|
static const bool isBigEndian = reinterpret_cast<const std::uint8_t*>(&test)[1] == 10;
|
||||||
return test == 1;
|
return isBigEndian;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user