Skip to content

Commit

Permalink
fix: Remove copy from callback based ProcessRequest overload
Browse files Browse the repository at this point in the history
Bug: N/A
Change-Id: I86a0c10ccbfce19ac71df91b7b60fb3c2c390142
GitOrigin-RevId: 0d388a9ecd79f74f0439c9ca4ac396e5f6163eff
  • Loading branch information
Privacy Sandbox Team authored and copybara-github committed Nov 22, 2024
1 parent b786256 commit eb94932
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/roma/byob/interface/roma_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class RomaService final {
absl::StatusOr<google::scp::roma::ExecutionToken> ProcessRequest(
std::string_view code_token, Request request, TMetadata /*metadata*/,
absl::AnyInvocable<void(absl::StatusOr<Response>,
absl::StatusOr<std::string_view> logs) &&>
absl::StatusOr<std::string_view>) &&>
callback) {
return dispatcher_->ProcessRequest(code_token, std::move(request),
std::move(callback));
Expand All @@ -242,8 +242,8 @@ class RomaService final {
code_token, std::move(request), std::move(metadata),
[callback = std::move(callback)](
absl::StatusOr<Response> response,
absl::StatusOr<std::string_view> logs) mutable {
std::move(callback)(response);
absl::StatusOr<std::string_view> /*logs*/) mutable {
std::move(callback)(std::move(response));
});
}

Expand All @@ -255,7 +255,7 @@ class RomaService final {
return ProcessRequest<Response>(
code_token, std::move(request), std::move(metadata),
[&notif, &output](absl::StatusOr<Response> response,
absl::StatusOr<std::string_view> logs) {
absl::StatusOr<std::string_view> /*logs*/) {
if (response.ok()) {
output = std::make_unique<Response>(*std::move(response));
} else {
Expand Down

0 comments on commit eb94932

Please sign in to comment.