bkietz commented on code in PR #36536: URL: https://github.com/apache/arrow/pull/36536#discussion_r1256088406
########## cpp/src/arrow/filesystem/s3fs.cc: ########## @@ -1158,7 +1179,7 @@ class ObjectInputFile final : public io::RandomAccessFile { req.SetKey(ToAwsString(path_.key)); ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock()); - auto outcome = client_lock->HeadObject(req); + auto outcome = std::move(client_lock)->HeadObject(req); Review Comment: Or you might even prefer ```c++ template <auto MemberPtr, typename... Args> auto S3ClientHolder::LockThenCall(Args&&... args) { return Lock().Map([&](S3ClientLock client_lock) { return (client_lock.get()->*MemberPtr)(std::forward<Args>(args)...); }); } ``` used like ```suggestion ARROW_ASSIGN_OR_RAISE(auto outcome, holder_->LockThenCall<&S3Client::HeadObject>(req)); ``` -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org