MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / priority_queue_empty

Function priority_queue_empty

priority_queue/priority_queue.c:375–384  ·  view source on GitHub ↗

* @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`. */

Source from the content-addressed store, hash-verified

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 */
378bool 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}

Callers

nothing calls this directly

Calls 1

vector_is_emptyFunction · 0.85

Tested by

no test coverage detected