MCPcopy Create free account
hub / github.com/Shannon-Data/ShannonBase / sort

Method sort

include/priority_queue.h:391–400  ·  view source on GitHub ↗

Sorts the elements of the priority queue according to the strict partial ordering defined by the object of type Less passed to the priority queue. The heap property of the priority queue is invalidated by this operation. */

Source from the content-addressed store, hash-verified

389 operation.
390 */
391 void sort() {
392 if (!m_container.empty()) {
393 for (size_type i = m_container.size() - 1; i > 0; --i) {
394 std::swap(m_container[i], m_container[0]);
395 m_marker(i, &m_container[i]);
396 m_marker(0, &m_container[0]);
397 heapify(0, i);
398 }
399 }
400 }
401
402 /// Clears the priority queue.
403 void clear() { m_container.clear(); }

Callers

nothing calls this directly

Calls 3

swapFunction · 0.70
sizeMethod · 0.65
emptyMethod · 0.45

Tested by

no test coverage detected