diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-03-27 02:06:44 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-03-27 02:06:44 +0100 |
commit | d48a969d3bd4bd977a771f7b059322d815c3e95e (patch) | |
tree | 82171404f0103caa6a209484d374eeb630ec5a45 /src/compiler/cpp_plugin.cc | |
parent | a8c7c201a46b14b3101b72025b1968a40b619a62 (diff) |
Small compiler optimization.
Diffstat (limited to 'src/compiler/cpp_plugin.cc')
-rw-r--r-- | src/compiler/cpp_plugin.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/cpp_plugin.cc b/src/compiler/cpp_plugin.cc index 57f25a1f75..acbe128213 100644 --- a/src/compiler/cpp_plugin.cc +++ b/src/compiler/cpp_plugin.cc @@ -58,6 +58,11 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { return false; } + if (file->service_count() == 0) { + // No services. Do nothing. + return true; + } + grpc_cpp_generator::Parameters generator_parameters; if (!parameter.empty()) { |