From 87d75d2a881ee2a71ada38ae52e87af38debea72 Mon Sep 17 00:00:00 2001 From: Na-Na Pang Date: Fri, 10 May 2019 11:23:24 -0700 Subject: [PATCH] Add explicit and fix error --- test/cpp/microbenchmarks/bm_cq.cc | 6 ++++-- test/cpp/microbenchmarks/callback_streaming_ping_pong.h | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc index caa5e7d6d31..50eb9454fbe 100644 --- a/test/cpp/microbenchmarks/bm_cq.cc +++ b/test/cpp/microbenchmarks/bm_cq.cc @@ -153,7 +153,9 @@ static void shutdown_and_destroy(grpc_completion_queue* cc) { // Tag completion queue iterate times class TagCallback : public grpc_experimental_completion_queue_functor { public: - TagCallback(int* iter) : iter_(iter) { functor_run = &TagCallback::Run; } + explicit TagCallback(int* iter) : iter_(iter) { + functor_run = &TagCallback::Run; + } ~TagCallback() {} static void Run(grpc_experimental_completion_queue_functor* cb, int ok) { GPR_ASSERT(static_cast(ok)); @@ -167,7 +169,7 @@ class TagCallback : public grpc_experimental_completion_queue_functor { // Check if completion queue is shut down class ShutdownCallback : public grpc_experimental_completion_queue_functor { public: - ShutdownCallback(bool* done) : done_(done) { + explicit ShutdownCallback(bool* done) : done_(done) { functor_run = &ShutdownCallback::Run; } ~ShutdownCallback() {} diff --git a/test/cpp/microbenchmarks/callback_streaming_ping_pong.h b/test/cpp/microbenchmarks/callback_streaming_ping_pong.h index 8f10fabc43b..0f4549df3ff 100644 --- a/test/cpp/microbenchmarks/callback_streaming_ping_pong.h +++ b/test/cpp/microbenchmarks/callback_streaming_ping_pong.h @@ -55,9 +55,7 @@ class BidiClient gpr_log(GPR_ERROR, "Client read failed"); return; } - if (writes_complete_ < msgs_to_send_) { - MaybeWrite(); - } + MaybeWrite(); } void OnWriteDone(bool ok) override {