MCPcopy Create free account
hub / github.com/copernet/copernicus / Erase

Method Erase

util/stack.go:53–64  ·  view source on GitHub ↗
(begin int, end int)

Source from the content-addressed store, hash-verified

51}
52
53func (s *Stack) Erase(begin int, end int) bool {
54 size := s.Size()
55 if begin < 0 || end < 0 || begin >= end || begin > size || end > size {
56 return false
57 }
58 for i := begin; i < end; i++ {
59 if !s.RemoveAt(begin) {
60 return false
61 }
62 }
63 return true
64}
65
66func (s *Stack) Insert(index int, value interface{}) bool {
67 if index > s.Size()-1 || index < 0 {

Callers 3

TestStackFunction · 0.95
removeWalletTxMethod · 0.45
EvalScriptFunction · 0.45

Calls 2

SizeMethod · 0.95
RemoveAtMethod · 0.95

Tested by 1

TestStackFunction · 0.76