@@ -559,7 +559,8 @@ namespace ts {
559
559
const symbolLinks: SymbolLinks[] = [];
560
560
const nodeLinks: NodeLinks[] = [];
561
561
const flowLoopCaches: Map<Type>[] = [];
562
- const flowAssignmentCaches: Map<Type>[] = [];
562
+ const flowAssignmentKeys: string[] = [];
563
+ const flowAssignmentTypes: FlowType[] = [];
563
564
const flowLoopNodes: FlowNode[] = [];
564
565
const flowLoopKeys: string[] = [];
565
566
const flowLoopTypes: Type[][] = [];
@@ -16390,10 +16391,8 @@ namespace ts {
16390
16391
const key = getOrSetCacheKey();
16391
16392
if (key) {
16392
16393
const id = getFlowNodeId(flow);
16393
- const cache = flowAssignmentCaches[id] || (flowAssignmentCaches[id] = createMap<Type>());
16394
- const cached = cache.get(key);
16395
- if (cached) {
16396
- return cached;
16394
+ if (flowAssignmentKeys[id] === key) {
16395
+ return flowAssignmentTypes[id];
16397
16396
}
16398
16397
}
16399
16398
}
@@ -16432,8 +16431,8 @@ namespace ts {
16432
16431
if (key && !isIncomplete(type)) {
16433
16432
flow.flags |= FlowFlags.Cached;
16434
16433
const id = getFlowNodeId(flow);
16435
- const cache = flowAssignmentCaches [id] || (flowAssignmentCaches[id] = createMap<Type>()) ;
16436
- cache.set(key, type as Type) ;
16434
+ flowAssignmentKeys [id] = key ;
16435
+ flowAssignmentTypes[id] = type ;
16437
16436
}
16438
16437
}
16439
16438
}
0 commit comments