pitrou commented on code in PR #35808:
URL: https://github.com/apache/arrow/pull/35808#discussion_r1210555986


##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -1304,27 +1304,43 @@ class ObjectOutputStream final : public 
io::OutputStream {
       return Status::Invalid("Operation on closed stream");
     }
 
-    if (!current_part_ && nbytes >= part_upload_threshold_) {
-      // No current part and data large enough, upload it directly
-      // (without copying if the buffer is owned)
-      RETURN_NOT_OK(UploadPart(data, nbytes, owned_buffer));
-      pos_ += nbytes;
-      return Status::OK();
+    const int8_t* data_ptr = reinterpret_cast<const int8_t*>(data);
+    int64_t offset = 0;

Review Comment:
   Instead of maintaining a separate offset, you can simply bump `data_ptr` and 
decrease `nbytes` as needed.



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