浏览代码

not empty

ming 7 年之前
父节点
当前提交
6074aaa988
共有 1 个文件被更改,包括 1 次插入1 次删除
  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));
   }