Skip to content

Commit cdba7d1

Browse files
authored
Merge pull request #564 from CodaFi/dead-code-elimination
2 parents 8f4a93e + fd121ef commit cdba7d1

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

Sources/SwiftDriver/Utilities/VirtualPath.swift

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -365,17 +365,10 @@ extension VirtualPath {
365365
fileprivate func intern(virtualPath path: VirtualPath) -> VirtualPath.Handle {
366366
return self.queue.sync(flags: .barrier) {
367367
guard let idx = self.uniquer[path.cacheKey] else {
368-
if let existing = self.uniquer[path.cacheKey] {
369-
// If there's an entry for the canonical path for this key, we just
370-
// need to vend its handle.
371-
return existing
372-
} else {
373-
// Otherwise we need to add an entry for the key.
374-
let nextSlot = self.table.count
375-
self.uniquer[path.cacheKey] = .init(nextSlot)
376-
self.table.append(path)
377-
return .init(nextSlot)
378-
}
368+
let nextSlot = self.table.count
369+
self.uniquer[path.cacheKey] = .init(nextSlot)
370+
self.table.append(path)
371+
return .init(nextSlot)
379372
}
380373
assert(idx.core >= 0, "Produced invalid index \(idx) for path \(path)")
381374
return idx

0 commit comments

Comments
 (0)