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

Function priority_queue_is_equal

priority_queue/priority_queue.c:743–758  ·  view source on GitHub ↗

* @brief Byte-exact equality of the underlying heap storage. * * Two queues are equal iff they point to the same PriorityQueue OR * they have matching size, item size, and every byte of storage * matches. * * NOTE: this compares STORAGE layout. Two heaps that contain the same * multiset of elements but were built in a different push order can * end up with different layouts and therefore c

Source from the content-addressed store, hash-verified

741 * @return true if the queues are byte-exact equal.
742 */
743bool priority_queue_is_equal(const PriorityQueue* a, const PriorityQueue* b) {
744 PQUEUE_LOG("[priority_queue_is_equal]: enter a=%p b=%p", (const void*)a, (const void*)b);
745 if (a == b) {
746 PQUEUE_LOG("[priority_queue_is_equal]: identity (a == b) -> true");
747 return true;
748 }
749 if (!a || !b || !a->vec || !b->vec) {
750 PQUEUE_LOG("[priority_queue_is_equal]: one receiver NULL -> false");
751 return false;
752 }
753
754 bool out = vector_is_equal(a->vec, b->vec);
755 PQUEUE_LOG("[priority_queue_is_equal]: exit -> %s", out ? "true" : "false");
756
757 return out;
758}
759
760
761/**

Calls 1

vector_is_equalFunction · 0.85

Tested by

no test coverage detected