Browse Source

not empty

ming 7 years ago
parent
commit
6074aaa988
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/google/protobuf/compiler/js/js_generator.cc

+ 1 - 1
src/google/protobuf/compiler/js/js_generator.cc

@@ -3478,7 +3478,7 @@ void Generator::GenerateFile(const GeneratorOptions& options,
   }
 
   // if provided is empty, do not export anything
-  if (options.import_style == GeneratorOptions::kImportCommonJs && provided.size()) {
+  if (options.import_style == GeneratorOptions::kImportCommonJs && !provided.empty()) {
     printer->Print("goog.object.extend(exports, $package$);\n",
                    "package", GetFilePath(options, file));
   }