mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-02 20:16:54 +01:00
Slightly simplify related-object adding code.
This commit is contained in:
parent
7563906f9b
commit
80c8a848e9
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user