Skip to content

Commit

Permalink
ARROW-17966: Prefer range loops where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
westonpace committed Oct 20, 2022
1 parent 59997e0 commit 26fd452
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp/src/arrow/engine/substrait/expression_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ Status DecodeOption(const substrait::FunctionOption& opt, SubstraitCall* call) {
return Status::Invalid("Invalid Substrait plan. The option ", opt.name(),
" is specified but does not list any choices");
}
for (int i = 0; i < opt.preference_size(); i++) {
prefs.push_back(opt.preference(i));
for (const auto& preference : opt.preference()) {
prefs.push_back(preference);
}
call->SetOption(opt.name(), prefs);
return Status::OK();
Expand All @@ -100,8 +100,8 @@ Result<SubstraitCall> DecodeScalarFunction(
ARROW_RETURN_NOT_OK(DecodeArg(scalar_fn.arguments(i), static_cast<uint32_t>(i), &call,
ext_set, conversion_options));
}
for (int i = 0; i < scalar_fn.options_size(); i++) {
ARROW_RETURN_NOT_OK(DecodeOption(scalar_fn.options(i), &call));
for (const auto& opt : scalar_fn.options()) {
ARROW_RETURN_NOT_OK(DecodeOption(opt, &call));
}
return std::move(call);
}
Expand Down

0 comments on commit 26fd452

Please sign in to comment.