Skip to content

Commit

Permalink
Return [Article] from articlesForIndexes() instead of Set<Article>
Browse files Browse the repository at this point in the history
  • Loading branch information
Wevah committed Apr 17, 2022
1 parent e1a6455 commit ae09d52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Mac/MainWindow/Timeline/TimelineViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr

var showsSearchResults = false
var selectedArticles: [Article] {
return Array(articles.articlesForIndexes(tableView.selectedRowIndexes))
return articles.articlesForIndexes(tableView.selectedRowIndexes)
}

var hasAtLeastOneSelectedArticle: Bool {
Expand Down
6 changes: 3 additions & 3 deletions Shared/Timeline/ArticleArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ extension Array where Element == Article {
return nil
}

func articlesForIndexes(_ indexes: IndexSet) -> Set<Article> {
return Set(indexes.compactMap{ (oneIndex) -> Article? in
func articlesForIndexes(_ indexes: IndexSet) -> [Article] {
return indexes.compactMap{ (oneIndex) -> Article? in
return articleAtRow(oneIndex)
})
}
}

func sortedByDate(_ sortDirection: ComparisonResult, groupByFeed: Bool = false) -> ArticleArray {
Expand Down

0 comments on commit ae09d52

Please sign in to comment.