From 17e7b0327870c1df4d479eb09c351e5d91bf66bb Mon Sep 17 00:00:00 2001 From: Alvar Hansen Date: Thu, 31 Mar 2022 08:16:31 +0300 Subject: [PATCH] Run target source pattern matching in parallel (#1197) As this transform closure does not access anything outside of its closure and does not mutate any singletons, then it seems to be safe to run this mapping in parallel. --- CHANGELOG.md | 4 ++++ Sources/XcodeGenKit/SourceGenerator.swift | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 153ea944..84003cb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ - Fix Monterey macOS shell version, shell login flag for environments [#1167](https://github.com/yonaskolb/XcodeGen/issues/1167) @bimawa - Fixed crash caused by a simultaneous write during a glob processing [#1177](https://github.com/yonaskolb/XcodeGen/issues/1177) @tr1ckyf0x +### Changed + +- Run target source pattern matching in parallel [#1197](https://github.com/yonaskolb/XcodeGen/pull/1197) @alvarhansen + ## 2.27.0 #### Added diff --git a/Sources/XcodeGenKit/SourceGenerator.swift b/Sources/XcodeGenKit/SourceGenerator.swift index fab9d3fe..e788ef09 100644 --- a/Sources/XcodeGenKit/SourceGenerator.swift +++ b/Sources/XcodeGenKit/SourceGenerator.swift @@ -359,7 +359,7 @@ class SourceGenerator { let rootSourcePath = project.basePath + targetSource.path return Set( - patterns.map { pattern in + patterns.parallelMap { pattern in guard !pattern.isEmpty else { return [] } return Glob(pattern: "\(rootSourcePath)/\(pattern)") .map { Path($0) }