Use a for-of loop for a dense array instead of iterating over keys and then indexing

This commit is contained in:
Andy Hanson
2016-10-03 08:32:37 -07:00
parent 7a1635f2f4
commit fcb4c2ba0f

View File

@@ -2308,8 +2308,7 @@ namespace ts {
extraVariableDeclarations = [];
}
// hoist collected variable declarations
for (const name in currentState.hoistedLocalVariables) {
const identifier = currentState.hoistedLocalVariables[name];
for (const identifier of currentState.hoistedLocalVariables) {
extraVariableDeclarations.push(createVariableDeclaration(identifier));
}
}