Explorar o código

Small compiler optimization.

Nicolas "Pixel" Noble %!s(int64=10) %!d(string=hai) anos
pai
achega
d48a969d3b
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      src/compiler/cpp_plugin.cc

+ 5 - 0
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()) {