diff options
author | Vijay Pai <vpai@google.com> | 2015-03-26 11:02:06 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2015-03-26 11:02:06 -0700 |
commit | bef9cbc7dc315450fe15d4b80b6ba34a0822ff2e (patch) | |
tree | 82c7eab35c0e62e09dca14b7a547849708fb4976 /test/cpp | |
parent | 96d3b8af32e2ffcca0d18bc5df7b0bf452131d4e (diff) |
Eliminate range-based fors
Diffstat (limited to 'test/cpp')
-rw-r--r-- | test/cpp/qps/client_async.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index e4e7e73762..590d56d8d0 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -281,16 +281,17 @@ class AsyncStreamingClient GRPC_FINAL : public Client { int t = 0; for (int i = 0; i < config.outstanding_rpcs_per_channel(); i++) { - for (auto &channel : channels_) { - auto *cq = cli_cqs_[t].get(); + for (auto channel = channels_.begin(); channel != channels_.end(); + channel++) { + auto* cq = cli_cqs_[t].get(); t = (t + 1) % cli_cqs_.size(); auto start_req = [cq](TestService::Stub *stub, grpc::ClientContext *ctx, void *tag) { auto stream = stub->AsyncStreamingCall(ctx, cq, tag); - return stream; + return stream; }; - TestService::Stub *stub = channel.get_stub(); + TestService::Stub *stub = channel->get_stub(); const SimpleRequest &request = request_; new ClientRpcContextStreamingImpl<SimpleRequest, SimpleResponse>( stub, request, start_req, check_done); @@ -303,11 +304,11 @@ class AsyncStreamingClient GRPC_FINAL : public Client { ~AsyncStreamingClient() GRPC_OVERRIDE { EndThreads(); - for (auto &cq : cli_cqs_) { - cq->Shutdown(); + for (auto cq = cli_cqs_.begin(); cq != cli_cqs_.end(); cq++) { + (*cq)->Shutdown(); void *got_tag; bool ok; - while (cq->Next(&got_tag, &ok)) { + while ((*cq)->Next(&got_tag, &ok)) { delete ClientRpcContext::detag(got_tag); } } |