Skip to content

Remove Some Dead Code #564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions Sources/SwiftDriver/Utilities/VirtualPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,10 @@ extension VirtualPath {
fileprivate func intern(virtualPath path: VirtualPath) -> VirtualPath.Handle {
return self.queue.sync(flags: .barrier) {
guard let idx = self.uniquer[path.cacheKey] else {
if let existing = self.uniquer[path.cacheKey] {
// If there's an entry for the canonical path for this key, we just
// need to vend its handle.
return existing
} else {
// Otherwise we need to add an entry for the key.
let nextSlot = self.table.count
self.uniquer[path.cacheKey] = .init(nextSlot)
self.table.append(path)
return .init(nextSlot)
}
let nextSlot = self.table.count
self.uniquer[path.cacheKey] = .init(nextSlot)
self.table.append(path)
return .init(nextSlot)
}
assert(idx.core >= 0, "Produced invalid index \(idx) for path \(path)")
return idx
Expand Down