MCPcopy Create free account
hub / github.com/plexdrive/plexdrive / adjustResponseChunk

Function adjustResponseChunk

chunk/manager.go:250–258  ·  view source on GitHub ↗
(req *Request, bytes []byte)

Source from the content-addressed store, hash-verified

248}
249
250func adjustResponseChunk(req *Request, bytes []byte) []byte {
251 if nil == bytes {
252 return nil
253 }
254 bytesLen := int64(len(bytes))
255 sOffset := min(req.chunkOffset, bytesLen)
256 eOffset := min(req.chunkOffsetEnd, bytesLen)
257 return bytes[sOffset:eOffset]
258}
259
260func min(x, y int64) int64 {
261 if x < y {

Callers 1

checkChunkMethod · 0.85

Calls 1

minFunction · 0.85

Tested by

no test coverage detected