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

Method Swap

util/stack.go:19–30  ·  view source on GitHub ↗
(i int, j int)

Source from the content-addressed store, hash-verified

17}
18
19func (s *Stack) Swap(i int, j int) bool {
20 if i > s.Size()-1 || i < 0 {
21 return false
22 }
23 if j > s.Size()-1 || j < 0 {
24 return false
25 }
26 s.array[i], s.array[j] = s.array[j], s.array[i]
27
28 return true
29
30}
31func (s *Stack) Pop() interface{} {
32 stackLen := len(s.array)
33 if stackLen == 0 {

Callers 3

TestStackFunction · 0.95
VerifyScriptFunction · 0.45
EvalScriptFunction · 0.45

Calls 1

SizeMethod · 0.95

Tested by 1

TestStackFunction · 0.76