Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit a466295

Browse files
committed
Only fire property change event if property has changed
Keep the property change event pattern consistent.
1 parent 6a494e3 commit a466295

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/GitHub.TeamFoundation.14/Services/VSGitExt.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public VSGitExt(IGitHubServiceProvider serviceProvider, IVSUIContextFactory fact
3838
context = factory.GetUIContext(new Guid(Guids.GitSccProviderId));
3939

4040
// Start with empty array until we have a change to initialize.
41-
ActiveRepositories = new ILocalRepositoryModel[0];
41+
ActiveRepositories = Array.Empty<ILocalRepositoryModel>();
4242

4343
if (context.IsActive && TryInitialize())
4444
{
@@ -97,7 +97,7 @@ void RefreshActiveRepositories()
9797
catch (Exception e)
9898
{
9999
log.Error(e, "Error refreshing repositories");
100-
ActiveRepositories = new ILocalRepositoryModel[0];
100+
ActiveRepositories = Array.Empty<ILocalRepositoryModel>();
101101
}
102102
}
103103

@@ -110,8 +110,11 @@ public IReadOnlyList<ILocalRepositoryModel> ActiveRepositories
110110

111111
private set
112112
{
113-
activeRepositories = value;
114-
ActiveRepositoriesChanged?.Invoke();
113+
if (value != activeRepositories)
114+
{
115+
activeRepositories = value;
116+
ActiveRepositoriesChanged?.Invoke();
117+
}
115118
}
116119
}
117120

0 commit comments

Comments
 (0)