Change from flatMap to new compactMap rename in Xcode 9.3.

This commit is contained in:
Daniel Jalkut
2018-01-27 21:50:48 -05:00
parent 2d7d903bca
commit d7f13ca4be
26 changed files with 152 additions and 35 deletions

View File

@@ -60,7 +60,7 @@ private extension RSSInJSONParser {
static func parseItems(_ itemsObject: JSONArray, _ feedURL: String) -> Set<ParsedItem> {
return Set(itemsObject.flatMap{ (oneItemDictionary) -> ParsedItem? in
return Set(itemsObject.compactMap{ (oneItemDictionary) -> ParsedItem? in
return parsedItemWithDictionary(oneItemDictionary, feedURL)
})
@@ -150,7 +150,7 @@ private extension RSSInJSONParser {
return nil
}
else if let categoryArray = itemDictionary["category"] as? JSONArray {
return Set(categoryArray.flatMap{ $0["#value"] as? String })
return Set(categoryArray.compactMap{ $0["#value"] as? String })
}
return nil
}