We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf874e6 commit 514b0d8Copy full SHA for 514b0d8
Sources/SwiftProtobufPluginLibrary/CodeGenerator.swift
@@ -250,11 +250,13 @@ private final class InternalGeneratorOutputs: GeneratorOutputs {
250
}
251
252
var files: [Google_Protobuf_Compiler_CodeGeneratorResponse.File] = []
253
+ private var fileNames: Set<String> = []
254
255
func add(fileName: String, contents: String) throws {
- guard !files.contains(where: { $0.name == fileName }) else {
256
+ guard !fileNames.contains(fileName) else {
257
throw OutputError.duplicateName(fileName)
258
259
+ fileNames.insert(fileName)
260
files.append(
261
Google_Protobuf_Compiler_CodeGeneratorResponse.File(
262
name: fileName,
0 commit comments