Vishwanatha-HD commented on code in PR #48217:
URL: https://github.com/apache/arrow/pull/48217#discussion_r2573004343


##########
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:
   @kiszk If I move this const int to line 387, then I wont be able to assign 
the value to this variable. Basically we wont be able to modify the value of 
the const variable once again.. The declaration and assignment should happen 
together & only once for const variables..
   
   `error: assignment of read-only variable ‘dst_stream’`



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