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 {
104
104
}
105
105
}
106
106
107
- var importInfos : [ ImportInfo ] = [ ]
107
+ var importInfos : [ ImportInfo ] ? = nil
108
108
if supportsImportInfos {
109
109
let importInfoSetRefOrNull = api. swiftscan_module_info_get_imports ( moduleInfoRef)
110
110
guard let importInfoSetRef = importInfoSetRefOrNull else {
111
111
throw DependencyScanningError . missingField ( " dependency_graph.imports " )
112
112
}
113
113
let importInfoRefArray = Array ( UnsafeBufferPointer ( start: importInfoSetRef. pointee. imports,
114
114
count: Int ( importInfoSetRef. pointee. count) ) )
115
- for importInfoRefOrNull in importInfoRefArray {
115
+ importInfos = try importInfoRefArray. map { importInfoRefOrNull in
116
116
guard let importInfoRef = importInfoRefOrNull else {
117
117
throw DependencyScanningError . missingField ( " dependency_set_t.imports[_] " )
118
118
}
119
- importInfos . append ( try constructImportInfo ( from: importInfoRef) )
119
+ return try constructImportInfo ( from: importInfoRef)
120
120
}
121
121
}
122
122
You can’t perform that action at this time.
0 commit comments