mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Slightly simplify related-object adding code.
This commit is contained in:
@@ -206,20 +206,11 @@ private extension ArticlesTable {
|
||||
var articles = Set<Article>()
|
||||
for stubArticle in articles {
|
||||
|
||||
var authors: Set<Author>? = nil
|
||||
var attachments: Set<Attachment>? = nil
|
||||
var tags: Set<String>? = nil
|
||||
let articleID = stubArticle.articleID
|
||||
|
||||
if let authorsMap = authorsMap {
|
||||
authors = authorsMap.authors(for: articleID)
|
||||
}
|
||||
if let attachmentsMap = attachmentsMap {
|
||||
attachments = attachmentsMap.attachments(for: articleID)
|
||||
}
|
||||
if let tagsMap = tagsMap {
|
||||
tags = tagsMap.tags(for: articleID)
|
||||
}
|
||||
let authors = authorsMap?.authors(for: articleID)
|
||||
let attachments = attachmentsMap?.attachments(for: articleID)
|
||||
let tags = tagsMap?.tags(for: articleID)
|
||||
|
||||
let realArticle = stubArticle.articleByAttaching(authors, attachments, tags)
|
||||
articles.insert(realArticle)
|
||||
|
||||
Reference in New Issue
Block a user