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:
@@ -879,9 +879,9 @@ private extension MasterFeedViewController {
|
||||
}
|
||||
|
||||
func applyToAvailableCells(_ completion: (MasterFeedTableViewCell, IndexPath) -> Void) {
|
||||
tableView.visibleCells.forEach { cell in
|
||||
for cell in tableView.visibleCells {
|
||||
guard let indexPath = tableView.indexPath(for: cell) else {
|
||||
return
|
||||
continue
|
||||
}
|
||||
completion(cell as! MasterFeedTableViewCell, indexPath)
|
||||
}
|
||||
|
||||
@@ -476,9 +476,12 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||
guard let feed = note.userInfo?[UserInfoKey.feed] as? Feed else {
|
||||
return
|
||||
}
|
||||
tableView.indexPathsForVisibleRows?.forEach { indexPath in
|
||||
guard let indexPathsForVisibleRows = tableView.indexPathsForVisibleRows else {
|
||||
return
|
||||
}
|
||||
for indexPath in indexPathsForVisibleRows {
|
||||
guard let article = dataSource.itemIdentifier(for: indexPath) else {
|
||||
return
|
||||
continue
|
||||
}
|
||||
if article.feed == feed, let cell = tableView.cellForRow(at: indexPath) as? MasterTimelineTableViewCell, let image = iconImageFor(article) {
|
||||
cell.setIconImage(image)
|
||||
@@ -490,9 +493,12 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||
guard coordinator.showIcons, let avatarURL = note.userInfo?[UserInfoKey.url] as? String else {
|
||||
return
|
||||
}
|
||||
tableView.indexPathsForVisibleRows?.forEach { indexPath in
|
||||
guard let indexPathsForVisibleRows = tableView.indexPathsForVisibleRows else {
|
||||
return
|
||||
}
|
||||
for indexPath in indexPathsForVisibleRows {
|
||||
guard let article = dataSource.itemIdentifier(for: indexPath), let authors = article.authors, !authors.isEmpty else {
|
||||
return
|
||||
continue
|
||||
}
|
||||
for author in authors {
|
||||
if author.avatarURL == avatarURL, let cell = tableView.cellForRow(at: indexPath) as? MasterTimelineTableViewCell, let image = iconImageFor(article) {
|
||||
|
||||
@@ -1468,7 +1468,7 @@ private extension SceneCoordinator {
|
||||
func rebuildArticleDictionaries() {
|
||||
var idDictionary = [String: Article]()
|
||||
|
||||
articles.forEach { article in
|
||||
for article in articles {
|
||||
idDictionary[article.articleID] = article
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user