Skip to content

Commit 4abe9b3

Browse files
authored
perf: improve perf in deleteUnresolvedResolutionsFromCache (#2320)
1 parent fcff44f commit 4abe9b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/language-server/src/plugins/typescript/module-loader.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ class ModuleResolutionCache {
6464
const fileNameWithoutEnding =
6565
getLastPartOfPath(this.getCanonicalFileName(path)).split('.').shift() || '';
6666
this.cache.forEach((val, key) => {
67+
if (val) {
68+
return;
69+
}
6770
const [containingFile, moduleName = ''] = key.split(CACHE_KEY_SEPARATOR);
68-
if (!val && moduleName.includes(fileNameWithoutEnding)) {
71+
if (moduleName.includes(fileNameWithoutEnding)) {
6972
this.cache.delete(key);
7073
this.pendingInvalidations.add(containingFile);
7174
}

0 commit comments

Comments
 (0)