rtpsw commented on code in PR #14480:
URL: https://github.com/apache/arrow/pull/14480#discussion_r1004481381
##########
cpp/src/arrow/compute/exec/exec_plan.cc:
##########
@@ -602,7 +602,9 @@ Future<std::vector<ExecBatch>>
DeclarationToExecBatchesAsync(Declaration declara
.Then([collected_fut, exec_plan]() -> Result<std::vector<ExecBatch>> {
ARROW_ASSIGN_OR_RAISE(auto collected, collected_fut.result());
return ::arrow::internal::MapVector(
- [](std::optional<ExecBatch> batch) { return std::move(*batch); },
+ [](std::optional<ExecBatch> batch) {
+ return ARROW_PREDICT_TRUE(batch) ? std::move(*batch) :
ExecBatch();
Review Comment:
Does `value_or` use something like `ARROW_PREDICT_TRUE` underneath? Granted,
the code changes here are not in performance-critical code, though they such
code may follow the example set here. Bottom line, if you want the conciseness
change, I'd be OK doing it.
--
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]