From d69b3135255469a98caf1cf40dd0bdcaf340dc17 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 16 Jun 2020 08:27:59 -0500 Subject: [PATCH] Optimize unread count lookup --- iOS/SceneCoordinator.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index ac7f86ced..13988f5f2 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -645,7 +645,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 {