diff --git a/node_modules/c9/ratelimit.js b/node_modules/c9/ratelimit.js index a56f6c3e..0b3cdcd3 100644 --- a/node_modules/c9/ratelimit.js +++ b/node_modules/c9/ratelimit.js @@ -18,9 +18,8 @@ function ratelimit(key, duration, max) { var expireTime = Date.now() - duration; /* Requests are already sorted by date as they are appended, so we just loop until we find one that shouldn't have expired and splice them from the list */ - for (var i = 0; i < requestsForHandle.length; i++) { - if (requestsForHandle[i] >= expireTime) break; - totalToSplice++; + for (totalToSplice = 0; totalToSplice < requestsForHandle.length; totalToSplice++) { + if (requestsForHandle[totalToSplice] >= expireTime) break; } requests[handle].splice(0, totalToSplice); if (requests[handle].length == 0) {