Extract collection performance refactors from mobile stack (#2854)

Co-authored-by: codex <[email protected]>
This commit is contained in:
Julius Marmingeandcodex authored and GitHub committed 2026-05-28 16:18:58 -07:00
1 parent 6b3050ee74
commit 31268945f8
47 files changed
+644 -453

No files matched your search

@@ -92,18 +92,17 @@ function selectProviderContext(
readonly url: string;
}>,
): SourceControlProvider.SourceControlProviderContext | null {
const candidates = remotes
.map((remote) => {
const provider = detectSourceControlProviderFromRemoteUrl(remote.url);
return provider
? {
provider,
remoteName: remote.name,
remoteUrl: remote.url,
}
: null;
})
.filter((value): value is SourceControlProvider.SourceControlProviderContext => value !== null);
const candidates: Array<SourceControlProvider.SourceControlProviderContext> = [];
for (const remote of remotes) {
const provider = detectSourceControlProviderFromRemoteUrl(remote.url);
if (provider) {
candidates.push({
provider,
remoteName: remote.name,
remoteUrl: remote.url,
});
}
}
return (
candidates.find((candidate) => candidate.remoteName === "origin") ??