Skip to content

Commit

Permalink
Improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
yefremov committed Feb 14, 2017
1 parent 6e46da8 commit 927c827
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ var waiting = [];
var waitingID = 0;

var callWaiting = function () {
var index = -1;
var length = waiting.length;
var funcs = waiting;

waiting = [];
waitingID = 0;

while (funcs.length) {
funcs.shift()();
while (++index < length) {
funcs[index]();
}
};

Expand Down

0 comments on commit 927c827

Please sign in to comment.