From d48a969d3bd4bd977a771f7b059322d815c3e95e Mon Sep 17 00:00:00 2001
From: "Nicolas \"Pixel\" Noble" <pixel@nobis-crew.org>
Date: Fri, 27 Mar 2015 02:06:44 +0100
Subject: [PATCH] Small compiler optimization.

---
 src/compiler/cpp_plugin.cc | 5 +++++
 1 file changed, 5 insertions(+)

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()) {
-- 
GitLab