// Pop removes the minimum element from the queue and returns it.
// The time complexity is O(log n) where n = q.Len().
12977
func (q *prioQueue) Pop() int {
	n := q.Len() - 1
	q.swap(0, n)
	q.down(0, n)

	v := q.heap[n]
	q.index[v] = -1
	q.heap = q.heap[:n]
	return v
}
990898
func (s *Stack) Pop() (elem interface{}) {
	if s.size == 0 {
		return nil
	}

	s.offset--
	s.size--

	if s.offset < 0 {
		s.offset = s.pageSize - 1

		s.currentPage, s.pages = s.pages[s.currentPageIndex-1], s.pages[:s.currentPageIndex+1]
		s.capacity -= s.pageSize
		s.currentPageIndex--
	}

	elem = s.currentPage[s.offset]

	return
}
325087
func (p *PopOp) Pop(id string) bool {
	if p.finished {
		panic("the operation has already been finished")
	}
	if !p.CanPop(id) {
		return false
	}
	p.tombs[id] = p.now
	p.popped = append(p.popped, &tombstone{
		id:      id,
		storage: p.idToKeys[id],
	})
	p.dirty = true
	return true
}
88557
func (p *pathHeap) Pop() interface{} {
	n := len(p.paths)
	x := p.paths[n-1]
	p.paths = p.paths[0 : n-1]
	return x
}
21429
func (m *SyncMap) Pop() (string, interface{}) {
	if m.Size() == 0 {
		panic("syncmap: map is empty")
	}

	var (
		key   string
		value interface{}
		found = false
		n     = int(m.shardCount)
	)

	for !found {
		idx := rand.Intn(n)
		shard := m.shards[idx]
		shard.Lock()
		if len(shard.items) > 0 {
			found = true
			for key, value = range shard.items {
				break
			}
			delete(shard.items, key)
		}
		shard.Unlock()
	}

	return key, value
}
601054
func (th *treeHeap) Pop() (popped interface{}) {
	popped = (*th)[len(*th)-1]
	*th = (*th)[:len(*th)-1]
	return
}
621215
func (s *ParseStack) Pop() AST {
	s.top--
	return s.container[s.top]
}
400479
func (s Set) Pop() (string, bool) {
	for k := range s {
		delete(s, k)
		return k, true
	}
	return "", false
}
284260
func (s *children) pop() (out *node) {
	index := len(*s) - 1
	out = (*s)[index]
	(*s)[index] = nil
	*s = (*s)[:index]
	return
}
1154245
func (s *testSuiteStack) Pop() *api.TestSuite {
	if s.IsEmpty() {
		return nil
	}
	oldNode := s.head
	s.head = s.head.Next
	return oldNode.Member
}
655886
func (ph *peerHeap) Pop() interface{} {
	lastIdx := len(ph.peers) - 1
	last := ph.peers[lastIdx]
	ph.peers = ph.peers[:lastIdx]
	return last
}
423681
func (h *Heap) Pop() (interface{}, error) {
	obj := heap.Pop(h.data)
	if obj != nil {
		if h.metricRecorder != nil {
			h.metricRecorder.Dec()
		}
		return obj, nil
	}
	return nil, fmt.Errorf("object was removed from heap data")
}
391917
func (p *PortList) Pop() string {
	if len(*p) == 0 {
		panic("list is empty")
	}
	val := (*p)[len(*p)-1]
	*p = (*p)[:len(*p)-1]
	return val
}
167969
func (s *Stack) Pop() (interface{}, error) {
	spin := s.spin
	for {
		head := atomic.LoadUint32(s.head)
		unlockedHead := head & unlockMask
		lockedHead := head | lockMask

		// Always work with unlocked head as head might be locked
		if unlockedHead == 0 {
			return nil, LimitError{"Stack is empty"}
		}

		if atomic.CompareAndSwapUint32(s.head, unlockedHead, lockedHead) {
			data := s.data[unlockedHead-1]             // copy data
			atomic.StoreUint32(s.head, unlockedHead-1) // unlock
			return data, nil                           // ### return ###
		}

		spin.Yield()
	}
}
758579
func (list *List) Pop() string {
	if list.length == 0 {
		return ""
	}
	if list.length == 1 {
		s := list.first.Content
		list.first = nil
		list.last = nil
		list.length--
		return s
	}
	s := list.last.Content
	var prev *ListItem
	tmp := list.first
	for i := 0; i < list.length; i++ {
		if i == list.length-2 {
			prev = tmp
			break
		} else {
			tmp = tmp.Next
		}
	}
	prev.Next = nil
	list.length--
	return s
}
282084
func (s *sccAcct) pop() Node {
	n := len(s.Stack)
	if n == 0 {
		return nil
	}
	node := s.Stack[n-1]
	s.Stack = s.Stack[:n-1]
	return node
}
510772
func Pop(n int) MutatorFunc {
	return func(state *LexerState) error {
		if len(state.Stack) == 0 {
			return fmt.Errorf("nothing to pop")
		}
		state.Stack = state.Stack[:len(state.Stack)-n]
		return nil
	}
}