aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-02-11 20:28:08 +0000
committerHolden Rohrer <hr@hrhr.dev>2020-02-11 15:30:33 -0500
commit3f124e1abb0979f460c79d95041f1eb23c3b74e8 (patch)
treef266e31c85434d4f653fcbb2bc0610bf43c07596
parent57d6b3e077f55b63ec98a5fefdbdae50b5335e09 (diff)
no longer sends `undefined` char with job pad step
-rw-r--r--tools/schedule.js2
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());
}