MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / pop

Method pop

sql/bounded_queue.h:118–127  ·  view source on GitHub ↗

Removes the top element from the queue. @retval Pointer to the (key of the) removed element. @note This function is for unit testing, where we push elements into to the queue, and test that the appropriate keys are retained. Interleaving of push() and pop() operations has not been tested. */

Source from the content-addressed store, hash-verified

116 Interleaving of push() and pop() operations has not been tested.
117 */
118 Key_type **pop()
119 {
120 // Don't return the extra element to the client code.
121 if (queue_is_full((&m_queue)))
122 queue_remove(&m_queue, 0);
123 DBUG_ASSERT(m_queue.elements > 0);
124 if (m_queue.elements == 0)
125 return NULL;
126 return reinterpret_cast<Key_type**>(queue_remove(&m_queue, 0));
127 }
128
129 /**
130 The number of elements in the queue.

Callers

nothing calls this directly

Calls 1

queue_removeFunction · 0.85

Tested by

no test coverage detected