MCPcopy Index your code
hub / github.com/plexdrive/plexdrive / Pop

Method Pop

chunk/stack.go:31–43  ·  view source on GitHub ↗

Pop pops the first item from the stack

()

Source from the content-addressed store, hash-verified

29
30// Pop pops the first item from the stack
31func (s *Stack) Pop() int {
32 s.lock.Lock()
33 defer s.lock.Unlock()
34 if s.items.Len() < s.maxSize {
35 return -1
36 }
37 item := s.items.Front()
38 if nil == item {
39 return -1
40 }
41 s.items.Remove(item)
42 return item.Value.(int)
43}
44
45// Touch moves the specified item to the last position of the stack
46func (s *Stack) Touch(item *list.Element) {

Callers 3

TestAddToStackFunction · 0.95
TestLenFunction · 0.95
StoreMethod · 0.80

Calls 2

LenMethod · 0.80
RemoveMethod · 0.45

Tested by 2

TestAddToStackFunction · 0.76
TestLenFunction · 0.76