Skip to content

Commit

Permalink
remove callback func copy
Browse files Browse the repository at this point in the history
Signed-off-by: Ruiyang Wang <[email protected]>
  • Loading branch information
rynewang committed Oct 5, 2024
1 parent d2a4267 commit fbb065b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ray/core_worker/test/normal_task_submitter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class MockWorkerClient : public rpc::CoreWorkerClientInterface {
if (callbacks.size() == 0) {
return false;
}
auto callback = callbacks.front();
const auto &callback = callbacks.front();
auto reply = rpc::PushTaskReply();
if (exit) {
reply.set_worker_exiting(true);
Expand Down Expand Up @@ -282,7 +282,7 @@ class MockRayletClient : public WorkerLeaseInterface {
if (callbacks.size() == 0) {
return false;
} else {
auto callback = callbacks.front();
const auto &callback = callbacks.front();
callback(Status::OK(), std::move(reply));
callbacks.pop_front();
return true;
Expand All @@ -294,7 +294,7 @@ class MockRayletClient : public WorkerLeaseInterface {
if (callbacks.size() == 0) {
return false;
} else {
auto callback = callbacks.front();
const auto &callback = callbacks.front();
callback(Status::RpcError("unavailable", grpc::StatusCode::UNAVAILABLE),
std::move(reply));
callbacks.pop_front();
Expand All @@ -308,7 +308,7 @@ class MockRayletClient : public WorkerLeaseInterface {
if (cancel_callbacks.size() == 0) {
return false;
} else {
auto callback = cancel_callbacks.front();
const auto &callback = cancel_callbacks.front();
callback(Status::OK(), std::move(reply));
cancel_callbacks.pop_front();
return true;
Expand Down

0 comments on commit fbb065b

Please sign in to comment.