rm redundant executeOperation function

This commit is contained in:
Pujit Mehrotra
2025-08-20 11:00:26 -04:00
parent 261d6c55ed
commit f704143ed3

View File

@@ -55,7 +55,7 @@ export class AsyncMutex<T = unknown> {
const op = (operation || this.defaultOperation) as AsyncOperation<U | T>;
const promise = this.executeOperation(op).finally(() => {
const promise = op().finally(() => {
if (this.currentOperation === promise) {
this.currentOperation = null;
}
@@ -64,8 +64,4 @@ export class AsyncMutex<T = unknown> {
this.currentOperation = promise;
return promise;
}
private async executeOperation<U>(operation: AsyncOperation<U>): Promise<U> {
return operation();
}
}