mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Remove a number of uses of forEach.
This commit is contained in:
@@ -802,9 +802,9 @@ private extension FeedViewController {
|
||||
}
|
||||
|
||||
func applyToAvailableCells(_ completion: (FeedTableViewCell, 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! FeedTableViewCell, indexPath)
|
||||
}
|
||||
|
||||
@@ -1450,7 +1450,7 @@ private extension SceneCoordinator {
|
||||
func rebuildArticleDictionaries() {
|
||||
var idDictionary = [String: Article]()
|
||||
|
||||
articles.forEach { article in
|
||||
for article in articles {
|
||||
idDictionary[article.articleID] = article
|
||||
}
|
||||
|
||||
|
||||
@@ -452,9 +452,9 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
guard let feed = note.userInfo?[UserInfoKey.feed] as? Feed else {
|
||||
return
|
||||
}
|
||||
tableView.indexPathsForVisibleRows?.forEach { indexPath in
|
||||
for indexPath in tableView.indexPathsForVisibleRows? {
|
||||
guard let article = dataSource.itemIdentifier(for: indexPath) else {
|
||||
return
|
||||
continue
|
||||
}
|
||||
if article.feed == feed, let cell = tableView.cellForRow(at: indexPath) as? TimelineTableViewCell, let image = iconImageFor(article) {
|
||||
cell.setIconImage(image)
|
||||
@@ -466,9 +466,9 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
guard coordinator.showIcons, let avatarURL = note.userInfo?[UserInfoKey.url] as? String else {
|
||||
return
|
||||
}
|
||||
tableView.indexPathsForVisibleRows?.forEach { indexPath in
|
||||
for indexPath in tableView.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? TimelineTableViewCell, let image = iconImageFor(article) {
|
||||
|
||||
@@ -13,7 +13,9 @@ extension Array where Element == CGRect {
|
||||
func maxY() -> CGFloat {
|
||||
|
||||
var y: CGFloat = 0.0
|
||||
self.forEach { y = Swift.max(y, $0.maxY) }
|
||||
for oneRect in self {
|
||||
y = Swift.max(y, oneRect.maxY)
|
||||
}
|
||||
return y
|
||||
}
|
||||
|
||||
|
||||
@@ -12,10 +12,9 @@ class RoundedProgressView: UIProgressView {
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
subviews.forEach { subview in
|
||||
for subview in subviews {
|
||||
subview.layer.masksToBounds = true
|
||||
subview.layer.cornerRadius = bounds.height / 2.0
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user