replace for-of with with for for performance reasons

This commit is contained in:
Ondrej Kraus 2015-02-25 14:41:20 +01:00
parent edb880f87c
commit c3f4091b6d

View File

@ -93,7 +93,8 @@ exports.Function = function (node, parent, scope, file) {
scope.traverse(node, memberExpressionVisitor, state);
if (state.isOptimizable) {
for (let candidate of state.candidates) {
for (let i = 0, count = state.candidates.length; i < count; ++i) {
let candidate = state.candidates[i];
optimizeMemberExpression(candidate.node, candidate.parent, node.params.length, state.strictMode);
}
return;