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

Method peek

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

Source from the content-addressed store, hash-verified

19}
20
21func (s *stack) peek(n int64) (Item, bool) {
22 index := int64(len(*s)) - 1 - n
23 if index < 0 || index >= int64(len(*s)) {
24 return nil, false
25 }
26 return (*s)[index], true
27}
28
29func (s *stack) push(v Item) {
30 *s = append(*s, v)

Callers 1

popMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected