File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Sources/SwiftDriver/SwiftScan Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -104,19 +104,19 @@ private extension SwiftScan {
104104 }
105105 }
106106
107- var importInfos : [ ImportInfo ] = [ ]
107+ var importInfos : [ ImportInfo ] ? = nil
108108 if supportsImportInfos {
109109 let importInfoSetRefOrNull = api. swiftscan_module_info_get_imports ( moduleInfoRef)
110110 guard let importInfoSetRef = importInfoSetRefOrNull else {
111111 throw DependencyScanningError . missingField ( " dependency_graph.imports " )
112112 }
113113 let importInfoRefArray = Array ( UnsafeBufferPointer ( start: importInfoSetRef. pointee. imports,
114114 count: Int ( importInfoSetRef. pointee. count) ) )
115- for importInfoRefOrNull in importInfoRefArray {
115+ importInfos = try importInfoRefArray. map { importInfoRefOrNull in
116116 guard let importInfoRef = importInfoRefOrNull else {
117117 throw DependencyScanningError . missingField ( " dependency_set_t.imports[_] " )
118118 }
119- importInfos . append ( try constructImportInfo ( from: importInfoRef) )
119+ return try constructImportInfo ( from: importInfoRef)
120120 }
121121 }
122122
You can’t perform that action at this time.
0 commit comments