feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -8,7 +8,6 @@
class Semaphore {
/**
* Creates an instance of Semaphore.
*
* @param {number} available the amount available number of "tasks"
* in the Semaphore
*/
@@ -41,12 +40,10 @@ class Semaphore {
}
_continue() {
if (this.available > 0) {
if (this.waiters.length > 0) {
this.available--;
const callback = /** @type {(function(): void)} */ (this.waiters.pop());
callback();
}
if (this.available > 0 && this.waiters.length > 0) {
this.available--;
const callback = /** @type {(function(): void)} */ (this.waiters.pop());
callback();
}
}
}