MCPcopy
hub / github.com/micro-editor/micro / Pop

Method Pop

internal/buffer/stack.go:28–35  ·  view source on GitHub ↗

Pop removes the top element from the stack and returns its value If the stack is empty, return nil

()

Source from the content-addressed store, hash-verified

26// Pop removes the top element from the stack and returns its value
27// If the stack is empty, return nil
28func (s *TEStack) Pop() (value *TextEvent) {
29 if s.Size > 0 {
30 value, s.Top = s.Top.Value, s.Top.Next
31 s.Size--
32 return
33 }
34 return nil
35}
36
37// Peek returns the top element of the stack without removing it
38func (s *TEStack) Peek() *TextEvent {

Callers 4

UndoOneEventMethod · 0.80
RedoOneEventMethod · 0.80
TestStackFunction · 0.80
CallMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestStackFunction · 0.64