aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/client_async.cc
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2015-03-24 10:36:08 -0700
committerGravatar Vijay Pai <vpai@google.com>2015-03-24 10:36:08 -0700
commit82dd80abc6fffab0f0bcff406dbd0750a6a45b37 (patch)
tree2015139aa7e4951be748b52d81ffacb7b36a04e5 /test/cpp/qps/client_async.cc
parent8ba8cfe143d47c8c9b14cd0cb0fbf968112cfc9c (diff)
Elminate range-based fors and work around some other limitations in older compilers
Diffstat (limited to 'test/cpp/qps/client_async.cc')
-rw-r--r--test/cpp/qps/client_async.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc
index 526f37a1fd..f995a63f49 100644
--- a/test/cpp/qps/client_async.cc
+++ b/test/cpp/qps/client_async.cc
@@ -144,7 +144,8 @@ class AsyncClient GRPC_FINAL : public Client {
int t = 0;
for (int i = 0; i < config.outstanding_rpcs_per_channel(); i++) {
- for (auto& channel : channels_) {
+ 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,
@@ -152,7 +153,7 @@ class AsyncClient GRPC_FINAL : public Client {
return stub->AsyncUnaryCall(ctx, request, cq, tag);
};
- TestService::Stub* stub = channel.get_stub();
+ TestService::Stub* stub = channel->get_stub();
const SimpleRequest& request = request_;
new ClientRpcContextUnaryImpl<SimpleRequest, SimpleResponse>(
stub, request, start_req, check_done);
@@ -165,11 +166,11 @@ class AsyncClient GRPC_FINAL : public Client {
~AsyncClient() 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);
}
}