Skip to content

Commit 4f6e7a7

Browse files
author
David Ungar
committed
Address comments
1 parent c972bf5 commit 4f6e7a7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/SwiftDriver/IncrementalCompilation/IncrementalCompilationState.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,7 @@ extension IncrementalCompilationState {
564564
var externalDependencySources = Set<DependencySource>()
565565
for extDepAndPrint in moduleDependencyGraph.fingerprintedExternalDependencies {
566566
let extDep = extDepAndPrint.externalDependency
567-
let extModTime = (try? fileSystem.getFileInfo(extDep.file).modTime)
568-
?? Date.distantFuture
567+
let extModTime = extDep.modTime(fileSystem) ?? Date.distantFuture
569568
if extModTime >= buildTime {
570569
for dependent in moduleDependencyGraph.untracedDependents(of: extDepAndPrint) {
571570
guard let dependencySource = dependent.dependencySource else {

Tests/SwiftDriverTests/ModuleDependencyGraphTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,10 +1212,11 @@ fileprivate struct SourceFileDependencyGraphMocker {
12121212
}
12131213

12141214
private mutating func addArc(def: Node, use: Node) {
1215+
dependencyAccumulator.reserveCapacity(use.sequenceNumber)
12151216
while dependencyAccumulator.count <= use.sequenceNumber {
12161217
dependencyAccumulator.append(nil)
12171218
}
1218-
var dh = dependencyAccumulator[use.sequenceNumber] ?? {
1219+
let dh = dependencyAccumulator[use.sequenceNumber] ?? {
12191220
let newOne = DependencyHolder()
12201221
dependencyAccumulator[use.sequenceNumber] = newOne
12211222
return newOne

0 commit comments

Comments
 (0)