diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-02-11 20:28:08 +0000 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-02-11 20:28:21 +0000 |
commit | 4fde8d201b089587aef027627cc5490a3671a884 (patch) | |
tree | 8b0556d07d8bdfd56737d425a7404f22dff22cec | |
parent | 0cdbd87a8eb1994c47dd8970fc6c948cf97fabab (diff) |
no longer sends `undefined` char with job pad step
-rw-r--r-- | tools/schedule.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/schedule.js b/tools/schedule.js index dfbe854..d8509b8 100644 --- a/tools/schedule.js +++ b/tools/schedule.js @@ -104,7 +104,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)){ // Step 5: Iterate through array (high->low), and subtract 1 until the length of output is num. - if (dequeued.length == num) break; + if (dequeued.length == num || job.data.length == 0) break; job.wacc--; dequeued.push(job.data.pop()); } |