Skip to content

Commit

Permalink
GH-33643: [C++] Remove implicit = capture of this which is not valid …
Browse files Browse the repository at this point in the history
…in c++20 (#33644)

* Closes: #33643

Authored-by: Weston Pace <weston.pace@gmail.com>
Signed-off-by: Weston Pace <weston.pace@gmail.com>
  • Loading branch information
westonpace committed Jan 13, 2023
1 parent e1027dc commit b55dd0e
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions cpp/src/arrow/compute/exec/source_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,24 @@ struct SourceNode : ExecNode {
bit_util::CeilDiv(morsel_length, ExecPlan::kMaxBatchSize));
batch_count_ += num_batches;
}
RETURN_NOT_OK(plan_->query_context()->ScheduleTask([=]() {
int64_t offset = 0;
do {
int64_t batch_size = std::min<int64_t>(
morsel_length - offset, ExecPlan::kMaxBatchSize);
// In order for the legacy batching model to work we must
// not slice batches from the source
if (use_legacy_batching) {
batch_size = morsel_length;
}
ExecBatch batch = morsel.Slice(offset, batch_size);
offset += batch_size;
outputs_[0]->InputReceived(this, std::move(batch));
} while (offset < morsel.length);
return Status::OK();
}));
RETURN_NOT_OK(plan_->query_context()->ScheduleTask(
[this, morsel = std::move(morsel), morsel_length,
use_legacy_batching]() {
int64_t offset = 0;
do {
int64_t batch_size = std::min<int64_t>(
morsel_length - offset, ExecPlan::kMaxBatchSize);
// In order for the legacy batching model to work we must
// not slice batches from the source
if (use_legacy_batching) {
batch_size = morsel_length;
}
ExecBatch batch = morsel.Slice(offset, batch_size);
offset += batch_size;
outputs_[0]->InputReceived(this, std::move(batch));
} while (offset < morsel.length);
return Status::OK();
}));
lock.lock();
if (!backpressure_future_.is_finished()) {
EVENT(span_, "Source paused due to backpressure");
Expand Down

0 comments on commit b55dd0e

Please sign in to comment.