]> git.codecow.com Git - libnemo.git/commitdiff
Eliminate redundant idle flag.
authorChris Duncan <chris@codecow.com>
Tue, 12 May 2026 13:55:19 +0000 (06:55 -0700)
committerChris Duncan <chris@codecow.com>
Tue, 12 May 2026 13:55:19 +0000 (06:55 -0700)
src/lib/vault/index.ts

index 16f410871989c05c84e65d9ace5eac2d6514ae97..bb75ffbaeaf862a7eef224940c5cefbecbf8189f 100644 (file)
@@ -21,7 +21,6 @@ const TERMINATED = 'Worker terminated'
 export class Vault {
        #eventTarget: EventTarget = new EventTarget()
        #job?: Task
-       #isIdle: boolean = true
        #isLocked: boolean = true
        #isTerminated: boolean = false
        #queue: Task[] = []
@@ -65,7 +64,7 @@ export class Vault {
                                reject
                        }
                        this.#queue.push(task)
-                       if (this.#isIdle) this.#process()
+                       if (this.#job == null) this.#process()
                })
        }
 
@@ -85,7 +84,6 @@ export class Vault {
 
        #process = (): void => {
                this.#job = this.#queue.shift()
-               this.#isIdle = this.#job == null
                if (this.#job != null) {
                        const { url, id, data, reject } = this.#job
                        const buffers: ArrayBuffer[] = []