Use a Set<ParsedAuthor> instead of [ParsedAuthor] array.

This commit is contained in:
Brent Simmons
2017-09-10 11:02:05 -07:00
parent 9a45ab7996
commit b1bd1ac75a
6 changed files with 25 additions and 12 deletions

View File

@@ -132,13 +132,13 @@ private extension RSSInJSONParser {
return nil
}
static func parseAuthors(_ itemDictionary: JSONDictionary) -> [ParsedAuthor]? {
static func parseAuthors(_ itemDictionary: JSONDictionary) -> Set<ParsedAuthor>? {
guard let authorEmailAddress = itemDictionary["author"] as? String else {
return nil
}
let parsedAuthor = ParsedAuthor(name: nil, url: nil, avatarURL: nil, emailAddress: authorEmailAddress)
return [parsedAuthor]
return Set([parsedAuthor])
}
static func parseTags(_ itemDictionary: JSONDictionary) -> [String]? {