fsaintjacques commented on a change in pull request #7256:
URL: https://github.com/apache/arrow/pull/7256#discussion_r432488488
##########
File path: cpp/src/arrow/util/basic_decimal.cc
##########
@@ -139,8 +144,13 @@ std::array<uint8_t, 16> BasicDecimal128::ToBytes() const {
void BasicDecimal128::ToBytes(uint8_t* out) const {
DCHECK_NE(out, nullptr);
- reinterpret_cast<uint64_t*>(out)[0] = BitUtil::ToLittleEndian(low_bits_);
- reinterpret_cast<int64_t*>(out)[1] = BitUtil::ToLittleEndian(high_bits_);
+#if ARROW_LITTLE_ENDIAN
+ reinterpret_cast<uint64_t*>(out)[0] = low_bits_;
Review comment:
You could replace this with the SafeLoad/SafeStore functions.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]