MCPcopy Index your code
hub / github.com/tinylib/msgp / skipDepth

Function skipDepth

msgp/read_bytes.go:1323–1343  ·  view source on GitHub ↗
(b []byte, depth int)

Source from the content-addressed store, hash-verified

1321}
1322
1323func skipDepth(b []byte, depth int) ([]byte, error) {
1324 if depth >= recursionLimit {
1325 return b, ErrRecursion
1326 }
1327 sz, asz, err := getSize(b)
1328 if err != nil {
1329 return b, err
1330 }
1331 if uintptr(len(b)) < sz {
1332 return b, ErrShortBytes
1333 }
1334 b = b[sz:]
1335 for asz > 0 {
1336 b, err = skipDepth(b, depth+1)
1337 if err != nil {
1338 return b, err
1339 }
1340 asz--
1341 }
1342 return b, nil
1343}
1344
1345// returns (skip N bytes, skip M objects, error)
1346func getSize(b []byte) (uintptr, uintptr, error) {

Callers 1

SkipFunction · 0.85

Calls 1

getSizeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…