GetMultiVarintLen find the length of encoded varints that follow a 1-byte tag.
(b []byte, num int)
| 1896 | // GetMultiVarintLen find the length of <num> encoded varints that follow a |
| 1897 | // 1-byte tag. |
| 1898 | func GetMultiVarintLen(b []byte, num int) (int, error) { |
| 1899 | p := 1 |
| 1900 | for i := 0; i < num && p < len(b); i++ { |
| 1901 | len, err := getVarintLen(b[p:]) |
| 1902 | if err != nil { |
| 1903 | return 0, err |
| 1904 | } |
| 1905 | p += len |
| 1906 | } |
| 1907 | return p, nil |
| 1908 | } |
| 1909 | |
| 1910 | // getMultiNonsortingVarintLen finds the length of <num> encoded nonsorting varints. |
| 1911 | func getMultiNonsortingVarintLen(b []byte, num int) (int, error) { |
no test coverage detected
searching dependent graphs…