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


##########
arrow/src/ipc/reader.rs:
##########
@@ -48,12 +48,11 @@ use DataType::*;
 /// compression does not yield appreciable savings.
 fn read_buffer(
     buf: &ipc::Buffer,
-    a_data: &[u8],
+    a_data: &Buffer,
     compression_codec: &Option<CompressionCodec>,
 ) -> Result<Buffer> {
     let start_offset = buf.offset() as usize;
-    let end_offset = start_offset + buf.length() as usize;
-    let buf_data = Buffer::from(&a_data[start_offset..end_offset]);
+    let buf_data = a_data.slice_with_length(start_offset, buf.length() as 
usize);

Review Comment:
   Why not just regular slice here?



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