Replace uses of forEach with for-in loops.

This commit is contained in:
Brent Simmons committed 2023-07-09 22:14:09 -07:00
1 parent 090e63b017
commit abb11afe3d
6 files changed
+43 -35

No files matched your search

@@ -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) {