* @brief Returns true if the priority queue has no elements (or is NULL). * * @param pq Queue pointer. NULL is treated as empty (returns true). * @return true if `pq == NULL` or `priority_queue_size(pq) == 0`. */
| 373 | * @brief Returns true if the priority queue has no elements (or is NULL). |
| 374 | * |
| 375 | * @param pq Queue pointer. NULL is treated as empty (returns true). |
| 376 | * @return true if `pq == NULL` or `priority_queue_size(pq) == 0`. |
| 377 | */ |
| 378 | bool priority_queue_empty(const PriorityQueue* pq) { |
| 379 | PQUEUE_LOG("[priority_queue_empty]: enter pq=%p", (const void*)pq); |
| 380 | if (!pq || !pq->vec) { |
| 381 | PQUEUE_LOG("[priority_queue_empty]: NULL receiver -> true"); |
| 382 | return true; |
| 383 | } |
| 384 | bool out = vector_is_empty(pq->vec); |
| 385 | PQUEUE_LOG("[priority_queue_empty]: exit -> %s", out ? "true" : "false"); |
| 386 | return out; |
| 387 | } |
nothing calls this directly
no test coverage detected