Skip to content

Commit 2b5ff29

Browse files
author
Andy
authored
Reduce map lookups (#24203)
1 parent 176e35b commit 2b5ff29

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15397,10 +15397,11 @@ namespace ts {
1539715397
links.resolvedSignatures = createMap();
1539815398
}
1539915399
const cacheKey = "" + getTypeId(valueType);
15400-
if (links.resolvedSignatures.get(cacheKey) && links.resolvedSignatures.get(cacheKey) !== resolvingSignaturesArray) {
15401-
signatures = links.resolvedSignatures.get(cacheKey);
15400+
const cachedResolved = links.resolvedSignatures.get(cacheKey);
15401+
if (cachedResolved && cachedResolved !== resolvingSignaturesArray) {
15402+
signatures = cachedResolved;
1540215403
}
15403-
else if (!links.resolvedSignatures.get(cacheKey)) {
15404+
else if (!cachedResolved) {
1540415405
links.resolvedSignatures.set(cacheKey, resolvingSignaturesArray);
1540515406
links.resolvedSignatures.set(cacheKey, signatures = instantiateJsxSignatures(context, signatures));
1540615407
}

0 commit comments

Comments
 (0)