Skip to content

Commit

Permalink
Move loop init variable assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Oct 10, 2017
1 parent 18f408f commit 0f0cbef
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/renderers/shared/shared/ReactTreeTraversal.js
Expand Up @@ -141,11 +141,10 @@ function traverseEnterLeave(from, to, fn, argFrom, argTo) {
pathTo.push(to);
to = getParent(to);
}
let i;
for (i = 0; i < pathFrom.length; i++) {
for (let i = 0; i < pathFrom.length; i++) {
fn(pathFrom[i], 'bubbled', argFrom);
}
for (i = pathTo.length; i-- > 0; ) {
for (let i = pathTo.length; i-- > 0; ) {
fn(pathTo[i], 'captured', argTo);
}
}
Expand Down

0 comments on commit 0f0cbef

Please sign in to comment.