MCPcopy
hub / github.com/julienschmidt/httprouter / shiftNRuneBytes

Function shiftNRuneBytes

tree.go:476–489  ·  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

474
475// shift bytes in array by n bytes left
476func shiftNRuneBytes(rb [4]byte, n int) [4]byte {
477 switch n {
478 case 0:
479 return rb
480 case 1:
481 return [4]byte{rb[1], rb[2], rb[3], 0}
482 case 2:
483 return [4]byte{rb[2], rb[3]}
484 case 3:
485 return [4]byte{rb[3]}
486 default:
487 return [4]byte{}
488 }
489}
490
491// recursive case-insensitive lookup function used by n.findCaseInsensitivePath
492func (n *node) findCaseInsensitivePathRec(path string, ciPath []byte, rb [4]byte, fixTrailingSlash bool) ([]byte, bool) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected