Browse Source

Renames `fastestSettled` to `asSettled`

main
Eric Amodio 1 year ago
parent
commit
97372b5f92
4 changed files with 7 additions and 7 deletions
  1. +2
    -2
      src/env/node/git/localGitProvider.ts
  2. +2
    -2
      src/git/gitProviderService.ts
  3. +2
    -2
      src/plus/github/githubGitProvider.ts
  4. +1
    -1
      src/system/promise.ts

+ 2
- 2
src/env/node/git/localGitProvider.ts View File

@ -161,7 +161,7 @@ import {
splitPath,
} from '../../../system/path';
import type { PromiseOrValue } from '../../../system/promise';
import { any, fastestSettled, getSettledValue } from '../../../system/promise';
import { any, asSettled, getSettledValue } from '../../../system/promise';
import { equalsIgnoreCase, getDurationMilliseconds, interpolate, splitSingle } from '../../../system/string';
import { PathTrie } from '../../../system/trie';
import { compare, fromString } from '../../../system/version';
@ -520,7 +520,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
if (remotes.length === 0) return [RepositoryVisibility.Local, undefined];
let local = true;
for await (const result of fastestSettled(remotes.map(r => this.getRemoteVisibility(r)))) {
for await (const result of asSettled(remotes.map(r => this.getRemoteVisibility(r)))) {
if (result.status !== 'fulfilled') continue;
if (result.value[0] === RepositoryVisibility.Public) {

+ 2
- 2
src/git/gitProviderService.ts View File

@ -34,7 +34,7 @@ import { count, filter, first, flatMap, join, map, some } from '../system/iterab
import { Logger } from '../system/logger';
import { getLogScope, setLogScopeExit } from '../system/logger.scope';
import { getBestPath, getScheme, isAbsolute, maybeUri, normalizePath } from '../system/path';
import { cancellable, fastestSettled, getSettledValue, isPromise, PromiseCancelledError } from '../system/promise';
import { asSettled, cancellable, getSettledValue, isPromise, PromiseCancelledError } from '../system/promise';
import { VisitedPathsTrie } from '../system/trie';
import type {
GitCaches,
@ -923,7 +923,7 @@ export class GitProviderService implements Disposable {
let isPrivate = false;
let isLocal = false;
for await (const result of fastestSettled(repositories.map(r => getRepoVisibility.call(this, r.path)))) {
for await (const result of asSettled(repositories.map(r => getRepoVisibility.call(this, r.path)))) {
if (result.status !== 'fulfilled') continue;
if (result.value === RepositoryVisibility.Public) {

+ 2
- 2
src/plus/github/githubGitProvider.ts View File

@ -85,7 +85,7 @@ import { Logger } from '../../system/logger';
import type { LogScope } from '../../system/logger.scope';
import { getLogScope } from '../../system/logger.scope';
import { isAbsolute, isFolderGlob, maybeUri, normalizePath, relative } from '../../system/path';
import { fastestSettled, getSettledValue } from '../../system/promise';
import { asSettled, getSettledValue } from '../../system/promise';
import { serializeWebviewItemContext } from '../../system/webview';
import type { CachedBlame, CachedLog } from '../../trackers/gitDocumentTracker';
import { GitDocumentState } from '../../trackers/gitDocumentTracker';
@ -238,7 +238,7 @@ export class GitHubGitProvider implements GitProvider, Disposable {
const remotes = await this.getRemotes(repoPath, { sort: true });
if (remotes.length === 0) return [RepositoryVisibility.Local, undefined];
for await (const result of fastestSettled(remotes.map(r => this.getRemoteVisibility(r)))) {
for await (const result of asSettled(remotes.map(r => this.getRemoteVisibility(r)))) {
if (result.status !== 'fulfilled') continue;
if (result.value[0] === RepositoryVisibility.Public) {

+ 1
- 1
src/system/promise.ts View File

@ -32,7 +32,7 @@ export function any(...promises: Promise[]): Promise {
});
}
export async function* fastestSettled<T>(promises: Promise<T>[]): AsyncIterable<PromiseSettledResult<T>> {
export async function* asSettled<T>(promises: Promise<T>[]): AsyncIterable<PromiseSettledResult<T>> {
const map = new Map(
promises.map((promise, i) => [
i,

Loading…
Cancel
Save