MCPcopy
hub / github.com/klauspost/compress / offsetCode

Function offsetCode

flate/token.go:365–379  ·  view source on GitHub ↗

Returns the offset code corresponding to a specific offset

(off uint32)

Source from the content-addressed store, hash-verified

363
364// Returns the offset code corresponding to a specific offset
365func offsetCode(off uint32) uint32 {
366 if false {
367 if off < uint32(len(offsetCodes)) {
368 return offsetCodes[off&255]
369 } else if off>>7 < uint32(len(offsetCodes)) {
370 return offsetCodes[(off>>7)&255] + 14
371 } else {
372 return offsetCodes[(off>>14)&255] + 28
373 }
374 }
375 if off < uint32(len(offsetCodes)) {
376 return offsetCodes[uint8(off)]
377 }
378 return offsetCodes14[uint8(off>>7)]
379}

Callers 4

EncodeMethod · 0.85
findMatchMethod · 0.85
AddMatchMethod · 0.85
AddMatchLongMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…