From d36175b1e8741c1a31e3d2bc545dd8a1b2bc6210 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Fri, 5 May 2017 08:51:18 -0700 Subject: [PATCH] Remove some redundant code in createJsxAttributesTypeFromAttributesProperty --- src/compiler/checker.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 84ff54391de..b717a4d196c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13293,19 +13293,15 @@ namespace ts { if (spread !== emptyObjectType) { if (attributesArray.length > 0) { spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); - attributesArray = []; - attributesTable = createMap(); } attributesArray = getPropertiesOfType(spread); } attributesTable = createMap(); - if (attributesArray) { - forEach(attributesArray, (attr) => { - if (!filter || filter(attr)) { - attributesTable.set(attr.name, attr); - } - }); + for (const attr of attributesArray) { + if (!filter || filter(attr)) { + attributesTable.set(attr.name, attr); + } } }