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:
@@ -749,7 +749,9 @@ extension AppDelegate {
|
||||
|
||||
@IBAction func debugDropConditionalGetInfo(_ sender: Any?) {
|
||||
#if DEBUG
|
||||
AccountManager.shared.activeAccounts.forEach{ $0.debugDropConditionalGetInfo() }
|
||||
for account in AccountManager.shared.activeAccounts {
|
||||
account.debugDropConditionalGetInfo()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -370,14 +370,14 @@ private extension SidebarOutlineDataSource {
|
||||
return false
|
||||
}
|
||||
|
||||
draggedFeeds.forEach { pasteboardFeed in
|
||||
for pasteboardFeed in draggedFeeds {
|
||||
guard let sourceAccountID = pasteboardFeed.accountID,
|
||||
let sourceAccount = AccountManager.shared.existingAccount(with: sourceAccountID),
|
||||
let feedID = pasteboardFeed.feedID,
|
||||
let feed = sourceAccount.existingFeed(withFeedID: feedID),
|
||||
let destinationContainer = parentNode.representedObject as? Container
|
||||
else {
|
||||
return
|
||||
continue
|
||||
}
|
||||
|
||||
var sourceContainer: Container = sourceAccount // default to top level,
|
||||
@@ -475,14 +475,14 @@ private extension SidebarOutlineDataSource {
|
||||
return false
|
||||
}
|
||||
|
||||
draggedFolders.forEach { pasteboardFolder in
|
||||
for pasteboardFolder in draggedFolders {
|
||||
guard let sourceAccountID = pasteboardFolder.accountID,
|
||||
let sourceAccount = AccountManager.shared.existingAccount(with: sourceAccountID),
|
||||
let folderStringID = pasteboardFolder.folderID,
|
||||
let folderID = Int(folderStringID),
|
||||
let folder = sourceAccount.existingFolder(withID: folderID)
|
||||
else {
|
||||
return
|
||||
continue
|
||||
}
|
||||
if !sameAccount(pasteboardFolder, parentNode) {
|
||||
copyFolderBetweenAccounts(folder: folder, to: parentNode)
|
||||
|
||||
@@ -1139,7 +1139,7 @@ private extension TimelineViewController {
|
||||
func updateArticleRowMap() {
|
||||
var rowMap = [String: [Int]]()
|
||||
var index = 0
|
||||
articles.forEach { (article) in
|
||||
for article in articles {
|
||||
if var indexes = rowMap[article.articleID] {
|
||||
indexes.append(index)
|
||||
rowMap[article.articleID] = indexes
|
||||
@@ -1160,9 +1160,9 @@ private extension TimelineViewController {
|
||||
func indexesForArticleIDs(_ articleIDs: Set<String>) -> IndexSet {
|
||||
var indexes = IndexSet()
|
||||
|
||||
articleIDs.forEach { (articleID) in
|
||||
for articleID in articleIDs {
|
||||
guard let rowsIndex = rows(for: articleID) else {
|
||||
return
|
||||
continue
|
||||
}
|
||||
for rowIndex in rowsIndex {
|
||||
indexes.insert(rowIndex)
|
||||
|
||||
Reference in New Issue
Block a user