Remove range-based for, comparisons to nullptr

pull/6863/head
Vijay Pai 9 years ago
parent 4e1a883a5f
commit 6b668cc93f
  1. 4
      src/cpp/ext/proto_server_reflection.cc
  2. 4
      src/cpp/ext/proto_server_reflection_plugin.cc
  3. 2
      test/cpp/util/proto_reflection_descriptor_database.cc

@ -197,8 +197,8 @@ Status ProtoServerReflection::GetAllExtensionNumbers(
std::vector<const protobuf::FieldDescriptor*> extensions; std::vector<const protobuf::FieldDescriptor*> extensions;
descriptor_pool_->FindAllExtensions(desc, &extensions); descriptor_pool_->FindAllExtensions(desc, &extensions);
for (auto extension : extensions) { for (auto it = extensions.begin(); it != extensions.end(); it++) {
response->add_extension_number(extension->number()); response->add_extension_number((*it)->number());
} }
response->set_base_type_name(type); response->set_base_type_name(type);
return Status::OK; return Status::OK;

@ -60,14 +60,14 @@ void ProtoServerReflectionPlugin::ChangeArguments(const grpc::string& name,
void* value) {} void* value) {}
bool ProtoServerReflectionPlugin::has_sync_methods() const { bool ProtoServerReflectionPlugin::has_sync_methods() const {
if (reflection_service_ != nullptr) { if (reflection_service_) {
return reflection_service_->has_synchronous_methods(); return reflection_service_->has_synchronous_methods();
} }
return false; return false;
} }
bool ProtoServerReflectionPlugin::has_async_methods() const { bool ProtoServerReflectionPlugin::has_async_methods() const {
if (reflection_service_ != nullptr) { if (reflection_service_) {
return reflection_service_->has_async_methods(); return reflection_service_->has_async_methods();
} }
return false; return false;

@ -298,7 +298,7 @@ void ProtoReflectionDescriptorDatabase::AddFileFromResponse(
const std::shared_ptr<ProtoReflectionDescriptorDatabase::ClientStream> const std::shared_ptr<ProtoReflectionDescriptorDatabase::ClientStream>
ProtoReflectionDescriptorDatabase::GetStream() { ProtoReflectionDescriptorDatabase::GetStream() {
if (stream_ == nullptr) { if (!stream_) {
stream_ = stub_->ServerReflectionInfo(&ctx_); stream_ = stub_->ServerReflectionInfo(&ctx_);
} }
return stream_; return stream_;

Loading…
Cancel
Save