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:
@@ -68,21 +68,24 @@ final class CloudKitAccountZone: CloudKitZone {
|
||||
}
|
||||
}
|
||||
|
||||
for item in items {
|
||||
if let feedSpecifier = item.feedSpecifier {
|
||||
processFeed(feedSpecifier: feedSpecifier, containerExternalID: rootExternalID)
|
||||
} else {
|
||||
if let title = item.titleFromAttributes {
|
||||
let containerRecord = newContainerCKRecord(name: title)
|
||||
records.append(containerRecord)
|
||||
item.children?.forEach { itemChild in
|
||||
if let feedSpecifier = itemChild.feedSpecifier {
|
||||
processFeed(feedSpecifier: feedSpecifier, containerExternalID: containerRecord.externalID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for item in items {
|
||||
if let feedSpecifier = item.feedSpecifier {
|
||||
processFeed(feedSpecifier: feedSpecifier, containerExternalID: rootExternalID)
|
||||
} else {
|
||||
if let title = item.titleFromAttributes {
|
||||
let containerRecord = newContainerCKRecord(name: title)
|
||||
records.append(containerRecord)
|
||||
|
||||
if let itemChildren = item.children {
|
||||
for itemChild in itemChildren {
|
||||
if let feedSpecifier = itemChild.feedSpecifier {
|
||||
processFeed(feedSpecifier: feedSpecifier, containerExternalID: containerRecord.externalID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
save(records, completion: completion)
|
||||
}
|
||||
|
||||
@@ -84,10 +84,10 @@ class CloudKitAcountZoneDelegate: CloudKitZoneDelegate {
|
||||
|
||||
@MainActor func removeFeed(_ externalID: String) {
|
||||
if let feed = account?.existingFeed(withExternalID: externalID), let containers = account?.existingContainers(withFeed: feed) {
|
||||
containers.forEach {
|
||||
feed.dropConditionalGetInfo()
|
||||
$0.removeFeed(feed)
|
||||
}
|
||||
for container in containers {
|
||||
feed.dropConditionalGetInfo()
|
||||
container.removeFeed(feed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,9 @@ protocol SidebarDelegate: AnyObject {
|
||||
}
|
||||
|
||||
let selectedItemIdentifers = Set(selectedFeedsState.compactMap( { ItemIdentifier(userInfo: $0) }))
|
||||
selectedItemIdentifers.forEach { treeControllerDelegate.addFilterException($0) }
|
||||
for selectedItemIdentifier in selectedItemIdentifers {
|
||||
treeControllerDelegate.addFilterException(selectedItemIdentifier)
|
||||
}
|
||||
|
||||
rebuildTreeAndReloadDataIfNeeded()
|
||||
|
||||
|
||||
@@ -82,12 +82,12 @@ private extension FeedTreeControllerDelegate {
|
||||
|
||||
var updatedChildNodes = [Node]()
|
||||
|
||||
children.forEach { (representedObject) in
|
||||
for representedObject in children {
|
||||
|
||||
if let existingNode = containerNode.childNodeRepresentingObject(representedObject) {
|
||||
if !updatedChildNodes.contains(existingNode) {
|
||||
updatedChildNodes += [existingNode]
|
||||
return
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user