mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Replace uses of forEach with for-in loops.
This commit is contained in:
@@ -759,7 +759,7 @@ private extension FeedbinAccountDelegate {
|
||||
// Feedbin has a tag that we don't have a folder for. We might not get a new
|
||||
// taggings response for it if it is a folder rename. Force expire the tagging
|
||||
// so that we will for sure get the new tagging information.
|
||||
tags.forEach { tag in
|
||||
for tag in tags {
|
||||
if !folderNames.contains(tag.name) {
|
||||
accountMetadata?.conditionalGetInfo[FeedbinAPICaller.ConditionalGetKeys.taggings] = nil
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ extension NewsBlurAccountDelegate {
|
||||
|
||||
// Delete any folders not at NewsBlur
|
||||
if let folders = account.folders {
|
||||
folders.forEach { folder in
|
||||
for folder in folders {
|
||||
if !folderNames.contains(folder.name ?? "") {
|
||||
for feed in folder.topLevelFeeds {
|
||||
account.addFeed(feed)
|
||||
@@ -66,7 +66,7 @@ extension NewsBlurAccountDelegate {
|
||||
|
||||
// Make any folders NewsBlur has, but we don't
|
||||
// Ignore account-level folder
|
||||
folderNames.forEach { folderName in
|
||||
for folderName in folderNames {
|
||||
if !accountFolderNames.contains(folderName) && folderName != " " {
|
||||
_ = account.ensureFolder(with: folderName)
|
||||
}
|
||||
@@ -100,7 +100,7 @@ extension NewsBlurAccountDelegate {
|
||||
|
||||
// Add any feeds we don't have and update any we do
|
||||
var feedsToAdd = Set<NewsBlurFeed>()
|
||||
feeds.forEach { newsBlurFeed in
|
||||
for newsBlurFeed in feeds {
|
||||
let subFeedID = String(newsBlurFeed.feedID)
|
||||
|
||||
if let feed = account.existingFeed(withFeedID: subFeedID) {
|
||||
@@ -117,7 +117,7 @@ extension NewsBlurAccountDelegate {
|
||||
}
|
||||
|
||||
// Actually add feeds all in one go, so we don’t trigger various rebuilding things that Account does.
|
||||
feedsToAdd.forEach { newsBlurFeed in
|
||||
for newsBlurFeed in feedsToAdd {
|
||||
let feed = account.createFeed(with: newsBlurFeed.name, url: newsBlurFeed.feedURL, feedID: String(newsBlurFeed.feedID), homePageURL: newsBlurFeed.homePageURL)
|
||||
feed.externalID = String(newsBlurFeed.feedID)
|
||||
account.addFeed(feed)
|
||||
|
||||
@@ -228,7 +228,7 @@ private extension TimelineViewController {
|
||||
}
|
||||
|
||||
let menu = NSMenu(title: NSLocalizedString("button.title.share", comment: "Share menu name"))
|
||||
services.forEach { (service) in
|
||||
for service in services {
|
||||
service.delegate = sharingServiceDelegate
|
||||
let menuItem = NSMenuItem(title: service.menuItemTitle, action: #selector(performShareServiceFromContextualMenu(_:)), keyEquivalent: "")
|
||||
menuItem.image = service.image
|
||||
|
||||
@@ -48,9 +48,9 @@ import Articles
|
||||
func perform() {
|
||||
|
||||
let group = DispatchGroup()
|
||||
itemSpecifiers.forEach {
|
||||
for itemSpecifier in itemSpecifiers {
|
||||
group.enter()
|
||||
$0.delete() {
|
||||
itemSpecifier.delete() {
|
||||
group.leave()
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,9 @@ import Articles
|
||||
}
|
||||
|
||||
func undo() {
|
||||
itemSpecifiers.forEach { $0.restore() }
|
||||
for itemSpecifier in itemSpecifiers {
|
||||
itemSpecifier.restore()
|
||||
}
|
||||
registerRedo()
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,9 @@ private extension SendToMarsEditCommand {
|
||||
|
||||
func appToUse() -> UserApp? {
|
||||
|
||||
marsEditApps.forEach{ $0.updateStatus() }
|
||||
for app in marsEditApps {
|
||||
app.updateStatus()
|
||||
}
|
||||
|
||||
for app in marsEditApps {
|
||||
if app.isRunning {
|
||||
|
||||
@@ -75,7 +75,9 @@ final class SmartFeed: PseudoFeed {
|
||||
if activeAccounts.isEmpty {
|
||||
updateUnreadCount()
|
||||
} else {
|
||||
activeAccounts.forEach { self.fetchUnreadCount(for: $0) }
|
||||
for account in activeAccounts {
|
||||
fetchUnreadCount(for: account)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import RSCore
|
||||
let faviconHost = URL(string: faviconURLString)?.host else {
|
||||
return
|
||||
}
|
||||
activeAccounts.forEach { account in
|
||||
for account in activeAccounts {
|
||||
for feed in Array(account.flattenedFeeds()) {
|
||||
if let feedURLHost = URL(string: feed.url)?.host {
|
||||
if faviconHost == feedURLHost {
|
||||
|
||||
Reference in New Issue
Block a user