MCPcopy Index your code
hub / github.com/google/codesearch / slice

Method slice

index/read.go:116–125  ·  view source on GitHub ↗

slice returns the slice of index data starting at the given byte offset. If n >= 0, the slice must have length at least n and is truncated to length n.

(off uint32, n int)

Source from the content-addressed store, hash-verified

114// slice returns the slice of index data starting at the given byte offset.
115// If n >= 0, the slice must have length at least n and is truncated to length n.
116func (ix *Index) slice(off uint32, n int) []byte {
117 o := int(off)
118 if uint32(o) != off || n >= 0 && o+n > len(ix.data.d) {
119 corrupt()
120 }
121 if n < 0 {
122 return ix.data.d[o:]
123 }
124 return ix.data.d[o : o+n]
125}
126
127// uint32 returns the uint32 value at the given offset in the index data.
128func (ix *Index) uint32(off uint32) uint32 {

Callers 8

uint32Method · 0.95
uvarintMethod · 0.95
strMethod · 0.95
listAtMethod · 0.95
dumpPostingMethod · 0.95
findListMethod · 0.95
loadMethod · 0.80
initMethod · 0.80

Calls 1

corruptFunction · 0.85

Tested by

no test coverage detected