Skip to content

Commit 4c82d91

Browse files
authored
Don't linearly search for fresh param in getConditionalType (#53662)
1 parent 7baf6cd commit 4c82d91

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17845,9 +17845,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1784517845
const context = createInferenceContext(freshParams, /*signature*/ undefined, InferenceFlags.None);
1784617846
if (freshMapper) {
1784717847
const freshCombinedMapper = combineTypeMappers(mapper, freshMapper);
17848-
for (const p of freshParams) {
17849-
if (root.inferTypeParameters.indexOf(p) === -1) {
17850-
p.mapper = freshCombinedMapper;
17848+
for (let i = 0; i < freshParams.length; i++) {
17849+
if (freshParams[i] !== root.inferTypeParameters[i]) {
17850+
freshParams[i].mapper = freshCombinedMapper;
1785117851
}
1785217852
}
1785317853
}

0 commit comments

Comments
 (0)