diff --git a/Account/Sources/Account/FeedMetadataFile.swift b/Account/Sources/Account/FeedMetadataFile.swift index 4ca8231ce..13083f207 100644 --- a/Account/Sources/Account/FeedMetadataFile.swift +++ b/Account/Sources/Account/FeedMetadataFile.swift @@ -35,7 +35,9 @@ import RSCore let decoder = PropertyListDecoder() account.feedMetadata = (try? decoder.decode(Account.FeedMetadataDictionary.self, from: fileData)) ?? Account.FeedMetadataDictionary() } - account.feedMetadata.values.forEach { $0.delegate = account } + for value in account.feedMetadata.values { + value.delegate = account + } } func save() { diff --git a/Mac/MainWindow/Sidebar/SidebarViewController.swift b/Mac/MainWindow/Sidebar/SidebarViewController.swift index 85e02fe69..fbd38b367 100644 --- a/Mac/MainWindow/Sidebar/SidebarViewController.swift +++ b/Mac/MainWindow/Sidebar/SidebarViewController.swift @@ -540,7 +540,9 @@ private extension SidebarViewController { } func addAllSelectedToFilterExceptions() { - selectedFeeds.forEach { addToFilterExeptionsIfNecessary($0) } + for feed in selectedFeeds { + addToFilterExeptionsIfNecessary(feed) + } } func addToFilterExeptionsIfNecessary(_ feedProtocol: FeedProtocol?) { @@ -583,7 +585,7 @@ private extension SidebarViewController { restoreSelection(to: savedSelection, sendNotificationIfChanged: true) // Automatically expand any new or newly active accounts - AccountManager.shared.activeAccounts.forEach { account in + for account in AccountManager.shared.activeAccounts { if !savedAccounts.contains(account) { let accountNode = treeController.nodeInTreeRepresentingObject(account) outlineView.expandItem(accountNode) diff --git a/Shared/ShareExtension/ExtensionFeedAddRequestFile.swift b/Shared/ShareExtension/ExtensionFeedAddRequestFile.swift index d5fd9d137..257c9f72f 100644 --- a/Shared/ShareExtension/ExtensionFeedAddRequestFile.swift +++ b/Shared/ShareExtension/ExtensionFeedAddRequestFile.swift @@ -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) { diff --git a/Shared/SmartFeeds/SmartFeed.swift b/Shared/SmartFeeds/SmartFeed.swift index 8a1ddd59f..77dc71325 100644 --- a/Shared/SmartFeeds/SmartFeed.swift +++ b/Shared/SmartFeeds/SmartFeed.swift @@ -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) }