mapleFU commented on PR #37641:
URL: https://github.com/apache/arrow/pull/37641#issuecomment-1735522173

   ```c++
   
         if (buffer[i].len == 0) {
           // If the buffer length is zero, the memcpy to data_ptr can be 
ignored.
           buffer[i].ptr = reinterpret_cast<const uint8_t*>(prefix.data());
           buffer[i].len = prefix_len_ptr[i];
         } else if (prefix_len_ptr[i] != 0) {
           // If the prefix length is zero, the prefix can be ignored.
           memcpy(data_ptr, prefix.data(), prefix_len_ptr[i]);
           // buffer[i] currently points to the string suffix
           memcpy(data_ptr + prefix_len_ptr[i], buffer[i].ptr, buffer[i].len);
           buffer[i].ptr = data_ptr;
           buffer[i].len += prefix_len_ptr[i];
           data_ptr += buffer[i].len;
         }
         prefix = std::string_view{buffer[i]};
   ```
   
   I tent to use code like this, but let me leave it to later patch with more 
carefully design...


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