MCPcopy Create free account
hub / github.com/devfeel/dotweb / shiftNRuneBytes

Function shiftNRuneBytes

tree.go:603–616  ·  view source on GitHub ↗

shift bytes in array by n bytes left

(rb [4]byte, n int)

Source from the content-addressed store, hash-verified

601
602// shift bytes in array by n bytes left
603func shiftNRuneBytes(rb [4]byte, n int) [4]byte {
604 switch n {
605 case 0:
606 return rb
607 case 1:
608 return [4]byte{rb[1], rb[2], rb[3], 0}
609 case 2:
610 return [4]byte{rb[2], rb[3]}
611 case 3:
612 return [4]byte{rb[3]}
613 default:
614 return [4]byte{}
615 }
616}
617
618// recursive case-insensitive lookup function used by n.findCaseInsensitivePath
619func (n *Node) findCaseInsensitivePathRec(path, loPath string, ciPath []byte, rb [4]byte, fixTrailingSlash bool) ([]byte, bool) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected