optimize(*): speed up for openning same repository that already opened before

This commit is contained in:
leo 2020-08-05 16:21:40 +08:00
parent 65d89897f1
commit 073c189f18
4 changed files with 22 additions and 12 deletions

View file

@ -54,8 +54,8 @@ namespace SourceGit {
if (main == null) return null;
if (repo == null) return (main.Tabs[0].Page as UI.Manager).popupManager;
for (int i = 1; i < main.openedTabs.Items.Count; i++) {
var opened = main.openedTabs.Items[i] as UI.Launcher.Tab;
for (int i = 1; i < main.Tabs.Count; i++) {
var opened = main.Tabs[i];
if (opened.Repo.Path == repo.Path) {
return (opened.Page as UI.Dashboard).popupManager;
}