Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 0fe6417

Browse files
committed
Also cache the username to avoid copying the connections array
The assets modification processor gets called a lot, and checking for the user in the callbacks means a copy of the connections array is made every single time. Add an event to signal that the connections array has changed instead so we can update the user whenever that happens and avoid the copy
1 parent bf243b7 commit 0fe6417

File tree

5 files changed

+191
-155
lines changed

5 files changed

+191
-155
lines changed

src/GitHub.Api/Authentication/IKeychain.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using System.Threading.Tasks;
34

45
namespace GitHub.Unity
@@ -17,5 +18,7 @@ public interface IKeychain
1718
bool HasKeys { get; }
1819
bool NeedsLoad { get; }
1920
void SetToken(UriString host, string token);
21+
22+
event Action ConnectionsChanged;
2023
}
2124
}

0 commit comments

Comments
 (0)