Skip to content

Commit 73d63ec

Browse files
committed
Switch to sameMap
1 parent 6966439 commit 73d63ec

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4821,20 +4821,8 @@ namespace ts {
48214821

48224822
function getInstantiatedConstructorsForTypeArguments(type: Type, typeArgumentNodes: TypeNode[], location: Node): Signature[] {
48234823
const signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location);
4824-
if (some(signatures)) {
4825-
const result: Signature[] = [];
4826-
const typeArguments = map(typeArgumentNodes, getTypeFromTypeNode);
4827-
for (const sig of signatures) {
4828-
if (some(sig.typeParameters)) {
4829-
result.push(getSignatureInstantiation(sig, typeArguments));
4830-
}
4831-
else {
4832-
result.push(sig);
4833-
}
4834-
}
4835-
return result;
4836-
}
4837-
return emptyArray;
4824+
const typeArguments = map(typeArgumentNodes, getTypeFromTypeNode);
4825+
return sameMap(signatures, sig => some(sig.typeParameters) ? getSignatureInstantiation(sig, typeArguments) : sig);
48384826
}
48394827

48404828
/**

0 commit comments

Comments
 (0)