From 5912a13ccb48313da191741931409a11b217d306 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Sat, 22 Feb 2020 22:56:41 +0000 Subject: removed global variable pollution --- tools/schedule.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/schedule.js') diff --git a/tools/schedule.js b/tools/schedule.js index b18f5e8..f9604bf 100644 --- a/tools/schedule.js +++ b/tools/schedule.js @@ -93,7 +93,7 @@ exports.Queue = function(delayms, maxExport, call){ // Step 3: Then, pop job.normweight*num//1 elems from remaining, without num decrease or normweight recalc. But keep job.wacc = job.normweight*num%1 let efflen = num - dequeued.length; - for (job of jobq){ + for (let job of jobq){ let topop = job.wt*efflen/weightsum; job.wacc += topop%1; topop = topop-topop%1; @@ -102,7 +102,7 @@ exports.Queue = function(delayms, maxExport, call){ } // Step 4: Shallow copy job array, and sort by job.wacc. - for (job of jobq.slice().sort((el, ne) => el.wacc-ne.wacc)){ + for (let job of jobq.slice().sort((el, ne) => el.wacc-ne.wacc)){ // Step 5: Iterate through array (high->low), and subtract 1 until the length of output is num. if (dequeued.length == num || job.data.length == 0) break; job.wacc--; -- cgit