File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ let portalItems: Set<PortalItem> = {
219219 // Omit the decoding errors from samples that don't have dependencies.
220220 let sampleDependencies = sampleJSONs
221221 . compactMap { try ? parseJSON ( at: $0) }
222- return Set ( sampleDependencies. flatMap ( \. offlineData) )
222+ return Set ( sampleDependencies. lazy . flatMap ( \. offlineData) )
223223 } catch {
224224 print ( " error: Error decoding Samples dependencies: \( error. localizedDescription) " )
225225 exit ( 1 )
@@ -245,11 +245,11 @@ var downloadedItems = previousDownloadedItems
245245// Asynchronously downloads portal items.
246246let dispatchGroup = DispatchGroup ( )
247247
248- portalItems . forEach { portalItem in
248+ for portalItem in portalItems {
249249 // Checks to see if an item is already downloaded.
250- guard ! downloadedItems. keys . contains ( portalItem. identifier) else {
250+ guard downloadedItems [ portalItem. identifier] == nil else {
251251 print ( " note: Item already downloaded: \( portalItem. identifier) " )
252- return
252+ continue
253253 }
254254
255255 let destinationURL = downloadDirectoryURL. appendingPathComponent ( portalItem. identifier, isDirectory: true )
You can’t perform that action at this time.
0 commit comments