mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-29 00:31:14 +00:00
Remove most uses of forEach. (Note: not talking about SwiftUI ForEach, which is fine and good and should not be removed.)
This commit is contained in:
1 parent
2d045b6c0f
commit
a9b4efeaab
31 files changed
+141
-105
No files matched your search
@@ -615,13 +615,16 @@ final class MainTimelineViewController: UITableViewController, UndoableCommandRu
|
||||
}
|
||||
|
||||
@objc func feedIconDidBecomeAvailable(_ note: Notification) {
|
||||
|
||||
guard let feed = note.userInfo?[UserInfoKey.feed] as? Feed else {
|
||||
return
|
||||
}
|
||||
tableView.indexPathsForVisibleRows?.forEach { indexPath in
|
||||
guard let indexPaths = tableView.indexPathsForVisibleRows else {
|
||||
return
|
||||
}
|
||||
|
||||
for indexPath in indexPaths {
|
||||
guard let article = dataSource.itemIdentifier(for: indexPath) else {
|
||||
return
|
||||
continue
|
||||
}
|
||||
if article.feed == feed {
|
||||
if let cell = tableView.cellForRow(at: indexPath) as? MainTimelineIconFeedCell, let image = iconImageFor(article) {
|
||||
@@ -635,9 +638,13 @@ final class MainTimelineViewController: UITableViewController, UndoableCommandRu
|
||||
guard showIcons, let avatarURL = note.userInfo?[UserInfoKey.url] as? String else {
|
||||
return
|
||||
}
|
||||
tableView.indexPathsForVisibleRows?.forEach { indexPath in
|
||||
guard let indexPaths = tableView.indexPathsForVisibleRows else {
|
||||
return
|
||||
}
|
||||
|
||||
for indexPath in indexPaths {
|
||||
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? MainTimelineIconFeedCell, let image = iconImageFor(article) {
|
||||
|
||||
Reference in new issue
Block a user