Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions eval/eval/function_step.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,20 +286,12 @@ absl::Status AbstractFunctionStep::Evaluate(ExecutionFrame* frame) const {
absl::StatusOr<ResolveResult> ResolveStatic(
absl::Span<const cel::Value> input_args,
absl::Span<const cel::FunctionOverloadReference> overloads) {
ResolveResult result = absl::nullopt;

for (const auto& overload : overloads) {
if (ArgumentKindsMatch(overload.descriptor, input_args)) {
// More than one overload matches our arguments.
if (result.has_value()) {
return absl::Status(absl::StatusCode::kInternal,
"Cannot resolve overloads");
}

result.emplace(overload);
return overload;
}
}
return result;
return absl::nullopt;
}

absl::StatusOr<ResolveResult> ResolveLazy(
Expand All @@ -315,7 +307,7 @@ absl::StatusOr<ResolveResult> ResolveLazy(
input_args.begin(), input_args.end(), arg_types.begin(),
[](const cel::Value& value) { return ValueKindToKind(value->kind()); });

cel::FunctionDescriptor matcher{name, receiver_style, arg_types};
cel::FunctionDescriptor matcher{name, receiver_style, std::move(arg_types)};

const cel::ActivationInterface& activation = frame.activation();
for (auto provider : providers) {
Expand Down