}
#assign (thread: Thread, job: Job): void {
- if (job.data instanceof ArrayBuffer) {
- if (job.data.byteLength > 0) {
- thread.job = job
- thread.worker.postMessage({ buffer: job.data }, [job.data])
- }
+ if (job.data instanceof ArrayBuffer && job.data.byteLength > 0) {
+ thread.job = job
+ thread.worker.postMessage({ buffer: job.data }, [job.data])
} else {
const chunk: number = 1 + (job.data.length / this.threadsIdle)
const next = job.data.slice(0, chunk)