aboutsummaryrefslogtreecommitdiff
path: root/tools/schedule.js
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-02-22 22:56:41 +0000
committerHolden Rohrer <hr@hrhr.dev>2020-02-23 22:39:22 +0000
commit5912a13ccb48313da191741931409a11b217d306 (patch)
tree15ac7a8f5652b117ccfefb6ff4d1ba96f7605a17 /tools/schedule.js
parent9770f779663ead9fad3ec79e3aff4becb1b44dee (diff)
removed global variable pollution
Diffstat (limited to 'tools/schedule.js')
-rw-r--r--tools/schedule.js4
1 files changed, 2 insertions, 2 deletions
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--;