MCPcopy
hub / github.com/go-chi/chi / replaceChild

Method replaceChild

tree.go:319–329  ·  view source on GitHub ↗
(label, tail byte, child *node)

Source from the content-addressed store, hash-verified

317}
318
319func (n *node) replaceChild(label, tail byte, child *node) {
320 for i := 0; i < len(n.children[child.typ]); i++ {
321 if n.children[child.typ][i].label == label && n.children[child.typ][i].tail == tail {
322 n.children[child.typ][i] = child
323 n.children[child.typ][i].label = label
324 n.children[child.typ][i].tail = tail
325 return
326 }
327 }
328 panic("chi: replacing missing child")
329}
330
331func (n *node) getEdge(ntyp nodeTyp, label, tail byte, prefix string) *node {
332 nds := n.children[ntyp]

Callers 1

InsertRouteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected