Replace uses of forEach with for-in loops.

This commit is contained in:
Brent Simmons
2023-07-09 22:29:37 -07:00
parent d3d718c1b0
commit e1d2560fc0
4 changed files with 13 additions and 5 deletions

View File

@@ -127,7 +127,11 @@ private extension ExtensionFeedAddRequestFile {
logger.error("Save to disk coordination failed: \(error.localizedDescription, privacy: .public)")
}
requests?.forEach { processRequest($0) }
if let requests {
for request in requests {
processRequest(request)
}
}
}
@MainActor func processRequest(_ request: ExtensionFeedAddRequest) {

View File

@@ -66,7 +66,7 @@ final class SmartFeed: PseudoFeed {
// Remove any accounts that are no longer active or have been deleted
let activeAccountIDs = activeAccounts.map { $0.accountID }
unreadCounts.keys.forEach { accountID in
for accountID in unreadCounts.keys {
if !activeAccountIDs.contains(accountID) {
unreadCounts.removeValue(forKey: accountID)
}