Skip to content

Commit

Permalink
Merge pull request #136992 from TwitchBronBron/faster-extension-versi…
Browse files Browse the repository at this point in the history
…on-picker

Fix perf issue for InstallAnotherVersionAction
  • Loading branch information
sandy081 committed Jan 18, 2022
2 parents 519638e + 0ea68e2 commit 66e97d1
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1032,13 +1032,18 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
}

const result: IGalleryExtensionVersion[] = [];
for (const version of galleryExtensions[0].versions) {
const seenVersions = new Set<string>();
await Promise.all(galleryExtensions[0].versions.map(async (version) => {
try {
if (result[result.length - 1]?.version !== version.version && await this.isValidVersion(version, includePreRelease, true, allTargetPlatforms, targetPlatform)) {
if (seenVersions.has(version.version)) {
return;
}
seenVersions.add(version.version);
if (await this.isValidVersion(version, includePreRelease, true, allTargetPlatforms, targetPlatform)) {
result.push({ version: version.version, date: version.lastUpdated, isPreReleaseVersion: isPreReleaseVersion(version) });
}
} catch (error) { /* Ignore error and skip version */ }
}
}));
return result;
}

Expand Down

0 comments on commit 66e97d1

Please sign in to comment.