westonpace commented on code in PR #14188:
URL: https://github.com/apache/arrow/pull/14188#discussion_r977911397
##########
cpp/src/arrow/dataset/dataset_writer.cc:
##########
@@ -174,19 +174,9 @@ class DatasetWriterFileQueue {
}
void ScheduleBatch(std::shared_ptr<RecordBatch> batch) {
- // TODO(ARROW-17110) This task is only here to std::move the batch
- // It can be a lambda once we adopt C++14
- struct WriteTask : public util::AsyncTaskScheduler::Task {
- WriteTask(DatasetWriterFileQueue* self, std::shared_ptr<RecordBatch>
batch)
- : self(self), batch(std::move(batch)) {}
- Result<Future<>> operator()(util::AsyncTaskScheduler*) {
- return self->WriteNext(std::move(batch));
- }
- DatasetWriterFileQueue* self;
- std::shared_ptr<RecordBatch> batch;
- };
- scheduler_->AddTask(
- ::arrow::internal::make_unique<WriteTask>(this, std::move(batch)));
+ scheduler_->AddSimpleTask([self = this, batch = std::move(batch)]() {
Review Comment:
Do we want to specify all arguments in this way or just the ones that we
need to capture specially? E.g. Is `[self = this, batch = std::move(batch)]`
preferred over `[this, batch = std::move(batch)]`?
--
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]