getMultiNonsortingVarintLen finds the length of encoded nonsorting varints.
(b []byte, num int)
| 1354 | |
| 1355 | // getMultiNonsortingVarintLen finds the length of <num> encoded nonsorting varints. |
| 1356 | func getMultiNonsortingVarintLen(b []byte, num int) (int, error) { |
| 1357 | p := 0 |
| 1358 | for i := 0; i < num && p < len(b); i++ { |
| 1359 | _, len, _, err := DecodeNonsortingStdlibVarint(b[p:]) |
| 1360 | if err != nil { |
| 1361 | return 0, err |
| 1362 | } |
| 1363 | p += len |
| 1364 | } |
| 1365 | return p, nil |
| 1366 | } |
| 1367 | |
| 1368 | // PeekLength returns the length of the encoded value at the start of b. Note: |
| 1369 | // if this function succeeds, it's not a guarantee that decoding the value will |
no test coverage detected
searching dependent graphs…