Skip to content

Commit fcb4c2b

Browse files
author
Andy Hanson
committed
Use a for-of loop for a dense array instead of iterating over keys and then indexing
1 parent 7a1635f commit fcb4c2b

File tree

1 file changed

+1
-2
lines changed
  • src/compiler/transformers

1 file changed

+1
-2
lines changed

src/compiler/transformers/es6.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2308,8 +2308,7 @@ namespace ts {
23082308
extraVariableDeclarations = [];
23092309
}
23102310
// hoist collected variable declarations
2311-
for (const name in currentState.hoistedLocalVariables) {
2312-
const identifier = currentState.hoistedLocalVariables[name];
2311+
for (const identifier of currentState.hoistedLocalVariables) {
23132312
extraVariableDeclarations.push(createVariableDeclaration(identifier));
23142313
}
23152314
}

0 commit comments

Comments
 (0)