aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/distributed_runtime/rpc
diff options
context:
space:
mode:
authorGravatar Amit Patankar <amitpatankar@google.com>2018-05-17 07:39:33 -0700
committerGravatar GitHub <noreply@github.com>2018-05-17 07:39:33 -0700
commitd8f9538ab48e3c677aaf532769d29bc29a05b76e (patch)
tree6cf824e9e53aa0c5e1813198f67060ed79ea80f7 /tensorflow/core/distributed_runtime/rpc
parent27779fc94b9711a220b46dd97d1c9e25b5f6ba26 (diff)
parent5e7cce81c90918d22ae514e9edb5f63e8295b5d5 (diff)
Merge pull request #19308 from u2takey/master
avoid magic number in AsyncService
Diffstat (limited to 'tensorflow/core/distributed_runtime/rpc')
-rw-r--r--tensorflow/core/distributed_runtime/rpc/grpc_master_service_impl.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/tensorflow/core/distributed_runtime/rpc/grpc_master_service_impl.cc b/tensorflow/core/distributed_runtime/rpc/grpc_master_service_impl.cc
index c832adbbbf..85adfd2c76 100644
--- a/tensorflow/core/distributed_runtime/rpc/grpc_master_service_impl.cc
+++ b/tensorflow/core/distributed_runtime/rpc/grpc_master_service_impl.cc
@@ -147,7 +147,9 @@ MasterService::Stub::Stub(
}
MasterService::AsyncService::AsyncService() {
- for (int i = 0; i < 10; ++i) {
+ int method_len = sizeof(grpcMasterService_method_names) /
+ sizeof(grpcMasterService_method_names[0]);
+ for (int i = 0; i < method_len; ++i) {
AddMethod(new ::grpc::internal::RpcServiceMethod(
grpcMasterService_method_names[i],
::grpc::internal::RpcMethod::NORMAL_RPC, nullptr));