Skip to content

Commit

Permalink
Tweak insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
finestructure committed Jan 12, 2024
1 parent 4e31865 commit 74ceb84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/ValidatorCore/Commands/CheckRedirects.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ extension Validator {
case .rateLimited:
fatalError("rate limited - should have been retried at a lower level")
case .redirected(let url):
guard await !normalizedPackageURLs.contains(url) else {
if await normalizedPackageURLs.insert(url).inserted {
print("ADD \(packageURL) -> \(url) (new)")
return url
} else {
print("DELETE \(packageURL) -> \(url) (exists)")
return nil
}
print("ADD \(packageURL) -> \(url) (new)")
await normalizedPackageURLs.insert(url)
return url
case .unauthorized:
print("package \(index) ...")
print("UNAUTHORIZED: \(packageURL.absoluteString) (deleting package)")
Expand Down

0 comments on commit 74ceb84

Please sign in to comment.