Skip to content

Commit a4fa025

Browse files
committed
Use seperate loops for source and target to reduce redundant calls
1 parent c4a09b9 commit a4fa025

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/compiler/checker.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -15106,12 +15106,15 @@ namespace ts {
1510615106
// conditional types, and resolve substitution types to either the substitution (on the source
1510715107
// side) or the type variable (on the target side).
1510815108
let source = originalSource;
15109-
let target = originalTarget;
1511015109
do {
1511115110
const s = getNormalizedType(source, /*writing*/ false);
15112-
const t = getNormalizedType(target, /*writing*/ true);
15113-
if (s === source && t === target) break;
15111+
if (s === source) break;
1511415112
source = s;
15113+
} while (true);
15114+
let target = originalTarget;
15115+
do {
15116+
const t = getNormalizedType(target, /*writing*/ true);
15117+
if (t === target) break;
1511515118
target = t;
1511615119
} while (true);
1511715120

0 commit comments

Comments
 (0)