MCPcopy
hub / github.com/golang/net / index

Method index

html/node.go:178–185  ·  view source on GitHub ↗

index returns the index of the top-most occurrence of n in the stack, or -1 if n is not present.

(n *Node)

Source from the content-addressed store, hash-verified

176// index returns the index of the top-most occurrence of n in the stack, or -1
177// if n is not present.
178func (s *nodeStack) index(n *Node) int {
179 for i := len(*s) - 1; i >= 0; i-- {
180 if (*s)[i] == n {
181 return i
182 }
183 }
184 return -1
185}
186
187// contains returns whether a is within s.
188func (s *nodeStack) contains(a atom.Atom) bool {

Callers 3

removeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected