MCPcopy Create free account
hub / github.com/chain/txvm / popN

Method popN

protocol/txvm/stack.go:41–49  ·  view source on GitHub ↗
(n int64)

Source from the content-addressed store, hash-verified

39}
40
41func (s *stack) popN(n int64) []Item {
42 var res []Item
43 for n > 0 && len(*s) > 0 {
44 res = append(res, (*s)[len(*s)-1])
45 *s = (*s)[:len(*s)-1]
46 n--
47 }
48 return res
49}
50
51func (s *stack) isEmpty() bool {
52 return len(*s) == 0

Callers 1

opReverseFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected