diff options
-rw-r--r-- | src/cpp/ext/proto_server_reflection.cc | 4 | ||||
-rw-r--r-- | src/cpp/ext/proto_server_reflection_plugin.cc | 4 | ||||
-rw-r--r-- | test/cpp/util/proto_reflection_descriptor_database.cc | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/cpp/ext/proto_server_reflection.cc b/src/cpp/ext/proto_server_reflection.cc index 348a035f0f..3973bfb58e 100644 --- a/src/cpp/ext/proto_server_reflection.cc +++ b/src/cpp/ext/proto_server_reflection.cc @@ -197,8 +197,8 @@ Status ProtoServerReflection::GetAllExtensionNumbers( std::vector<const protobuf::FieldDescriptor*> extensions; descriptor_pool_->FindAllExtensions(desc, &extensions); - for (auto extension : extensions) { - response->add_extension_number(extension->number()); + for (auto it = extensions.begin(); it != extensions.end(); it++) { + response->add_extension_number((*it)->number()); } response->set_base_type_name(type); return Status::OK; diff --git a/src/cpp/ext/proto_server_reflection_plugin.cc b/src/cpp/ext/proto_server_reflection_plugin.cc index 7f9b667356..5b806ce1ae 100644 --- a/src/cpp/ext/proto_server_reflection_plugin.cc +++ b/src/cpp/ext/proto_server_reflection_plugin.cc @@ -60,14 +60,14 @@ void ProtoServerReflectionPlugin::ChangeArguments(const grpc::string& name, void* value) {} bool ProtoServerReflectionPlugin::has_sync_methods() const { - if (reflection_service_ != nullptr) { + if (reflection_service_) { return reflection_service_->has_synchronous_methods(); } return false; } bool ProtoServerReflectionPlugin::has_async_methods() const { - if (reflection_service_ != nullptr) { + if (reflection_service_) { return reflection_service_->has_async_methods(); } return false; diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc index 6907d97bd5..25b720aee0 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.cc +++ b/test/cpp/util/proto_reflection_descriptor_database.cc @@ -298,7 +298,7 @@ void ProtoReflectionDescriptorDatabase::AddFileFromResponse( const std::shared_ptr<ProtoReflectionDescriptorDatabase::ClientStream> ProtoReflectionDescriptorDatabase::GetStream() { - if (stream_ == nullptr) { + if (!stream_) { stream_ = stub_->ServerReflectionInfo(&ctx_); } return stream_; |