Optimize unread count look up

This commit is contained in:
Maurice Parker 2020-06-16 08:32:01 -05:00
parent 7dd20560c3
commit 5356189654
1 changed files with 1 additions and 1 deletions

View File

@ -626,7 +626,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
func unreadCountFor(_ node: Node) -> Int {
// The coordinator supplies the unread count for the currently selected feed
if let feed = timelineFeed, let selectedNode = rootNode.descendantNodeRepresentingObject(feed as AnyObject), selectedNode == node {
if node.representedObject === timelineFeed as AnyObject {
return unreadCount
}
if let unreadCountProvider = node.representedObject as? UnreadCountProvider {