You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/19 07:53:44 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #2510: Avoid useless memory copies in IPC reader.

tustvold commented on code in PR #2510:
URL: https://github.com/apache/arrow-rs/pull/2510#discussion_r949906313


##########
arrow/src/ipc/reader.rs:
##########
@@ -53,14 +53,11 @@ fn read_buffer(
 ) -> Result<Buffer> {
     let start_offset = buf.offset() as usize;
     let end_offset = start_offset + buf.length() as usize;
-    let buf_data = &a_data[start_offset..end_offset];
+    let buf_data = Buffer::from(&a_data[start_offset..end_offset]);

Review Comment:
   Looking at the calculation above, I think we don't need to truncate the length, as end_offset is the end of the buffer?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org