Fix OPML import performance regression. Fix #238.

This commit is contained in:
Brent Simmons 2017-12-11 23:12:54 -08:00
parent 0b4a9f143e
commit 3eb95ce63d

View File

@ -240,22 +240,21 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
if let folder = folder {
didAddFeed = folder.addFeed(uniquedFeed)
if didAddFeed {
addToFeedDictionaries(uniquedFeed)
}
}
else {
if !topLevelObjectsContainsFeed(uniquedFeed) {
children += [uniquedFeed]
addToFeedDictionaries(uniquedFeed)
dirty = true
postChildrenDidChangeNotification()
}
didAddFeed = true
}
rebuildFeedDictionaries()
return didAddFeed // TODO
if didAddFeed {
addToFeedDictionaries(uniquedFeed)
dirty = true
}
return didAddFeed
}
public func createFeed(with name: String?, editedName: String?, url: String) -> Feed? {
@ -301,6 +300,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
guard let children = opmlDocument.children else {
return
}
rebuildFeedDictionaries()
importOPMLItems(children, parentFolder: nil)
dirty = true