From bb8674c17cd52acc32ca719f5f32519b7e8bc5d2 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Sun, 7 Jan 2024 11:11:18 -0600 Subject: [PATCH] Null coalesce not necessary. --- src/PriorityQueue.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PriorityQueue.php b/src/PriorityQueue.php index e01723c2..2e6a8395 100644 --- a/src/PriorityQueue.php +++ b/src/PriorityQueue.php @@ -101,7 +101,7 @@ public function extract(int $priority = \PHP_INT_MAX): int|string|null */ public function peekData(): int|string|null { - return ($this->data[0] ?? null)?->key ?? null; + return ($this->data[0] ?? null)?->key; } /** @@ -109,7 +109,7 @@ public function peekData(): int|string|null */ public function peekPriority(): ?int { - return ($this->data[0] ?? null)?->priority ?? null; + return ($this->data[0] ?? null)?->priority; } public function isEmpty(): bool