-
Notifications
You must be signed in to change notification settings - Fork 0
实战列表缓存键使用 Bool toggle 导致前进一步变慢 #65
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
问题描述
Session.relatedRealGamesForCurrentFen 的缓存版本键使用了 self.dataChanged(Bool toggle),该值在每次 notifyDataChanged() 调用时都会翻转,导致前进/后退每一步缓存都不命中,每步都重新执行 computeRelatedRealGames()。
引入提交:da26a6e(实战列表功能 #54)
期望行为
缓存版本键应使用 databaseView.dataVersion(递增 Int),仅在数据库内容真正修改时才失效,前进/后退导航时缓存应正确命中。
修复
将 _cachedRealGamesDataVersion 类型从 Bool 改为 Int,缓存键从 self.dataChanged 改为 databaseView.dataVersion。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working