Skip to content

Commit

Permalink
perf: improve perf in deleteUnresolvedResolutionsFromCache (#2320)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlyu123 authored Mar 23, 2024
1 parent fcff44f commit 4abe9b3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ class ModuleResolutionCache {
const fileNameWithoutEnding =
getLastPartOfPath(this.getCanonicalFileName(path)).split('.').shift() || '';
this.cache.forEach((val, key) => {
if (val) {
return;
}
const [containingFile, moduleName = ''] = key.split(CACHE_KEY_SEPARATOR);
if (!val && moduleName.includes(fileNameWithoutEnding)) {
if (moduleName.includes(fileNameWithoutEnding)) {
this.cache.delete(key);
this.pendingInvalidations.add(containingFile);
}
Expand Down

0 comments on commit 4abe9b3

Please sign in to comment.