kiszk commented on code in PR #48217:
URL: https://github.com/apache/arrow/pull/48217#discussion_r2569917382


##########
cpp/src/arrow/util/byte_stream_split_internal.h:
##########
@@ -376,24 +387,21 @@ inline void DoMergeStreams(const uint8_t** src_streams, 
int width, int64_t nvalu
       for (int i = 0; i < kBlockSize; i += 8) {
         uint64_t v = arrow::util::SafeLoadAs<uint64_t>(&src[i]);
 #if ARROW_LITTLE_ENDIAN
-        dest[stream + i * width] = static_cast<uint8_t>(v);
-        dest[stream + (i + 1) * width] = static_cast<uint8_t>(v >> 8);
-        dest[stream + (i + 2) * width] = static_cast<uint8_t>(v >> 16);
-        dest[stream + (i + 3) * width] = static_cast<uint8_t>(v >> 24);
-        dest[stream + (i + 4) * width] = static_cast<uint8_t>(v >> 32);
-        dest[stream + (i + 5) * width] = static_cast<uint8_t>(v >> 40);
-        dest[stream + (i + 6) * width] = static_cast<uint8_t>(v >> 48);
-        dest[stream + (i + 7) * width] = static_cast<uint8_t>(v >> 56);
+        const int dest_stream = stream;

Review Comment:
   Is it better to move `const int ...` for both endians to line 387?  While a 
compiler may move it in the current code, it is sure to move it in the source 
code. 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to