From 5ba172fb202c18946127e87ec74369e19d0148e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20C=C3=B4ng=20Tu=E1=BA=A5n?= Date: Wed, 20 Nov 2024 16:05:26 +0700 Subject: [PATCH] chore: Replace type casting with nullish coalescing (cherry picked from commit f852e28d5ace4b75276b5ba1a70a1adc8838b16d) --- src/task_queue/array_queue.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/task_queue/array_queue.ts b/src/task_queue/array_queue.ts index f20814cd..6d215152 100644 --- a/src/task_queue/array_queue.ts +++ b/src/task_queue/array_queue.ts @@ -10,7 +10,7 @@ export class ArrayTaskQueue implements TaskQueue { } shift (): Task | null { - return this.tasks.shift() as Task; + return this.tasks.shift() ?? null; } push (task: Task): void {