MCPcopy Index your code
hub / github.com/dispatchrun/coroutine / Pop

Function Pop

coroutine_durable.go:78–86  ·  view source on GitHub ↗

Pop pops the topmost stack frame after a function call.

(s *Stack)

Source from the content-addressed store, hash-verified

76
77// Pop pops the topmost stack frame after a function call.
78func Pop(s *Stack) {
79 if !s.isTop() {
80 panic("pop when caller is not on topmost frame")
81 }
82 i := len(s.Frames) - 1
83 s.Frames[i] = nil
84 s.Frames = s.Frames[:i]
85 s.FP--
86}
87
88func (s *Stack) isTop() bool {
89 return s.FP == len(s.Frames)-1

Callers 15

SquareGeneratorFunction · 0.92
SquareGeneratorTwiceFunction · 0.92
SquareGeneratorTwiceLoopFunction · 0.92
EvenSquareGeneratorFunction · 0.92
NestedLoopsFunction · 0.92
FizzBuzzIfGeneratorFunction · 0.92
FizzBuzzSwitchGeneratorFunction · 0.92
ShadowingFunction · 0.92
RangeSliceIndexGeneratorFunction · 0.92
TypeSwitchingGeneratorFunction · 0.92
LoopBreakAndContinueFunction · 0.92

Calls 1

isTopMethod · 0.80

Tested by

no test coverage detected