EncodeNonsortingStdlibVarint encodes an int value using encoding/binary, appends it to the supplied buffer, and returns the final buffer.
(appendTo []byte, x int64)
| 1700 | // EncodeNonsortingStdlibVarint encodes an int value using encoding/binary, appends it |
| 1701 | // to the supplied buffer, and returns the final buffer. |
| 1702 | func EncodeNonsortingStdlibVarint(appendTo []byte, x int64) []byte { |
| 1703 | // Fixed size array to allocate this on the stack. |
| 1704 | var scratch [binary.MaxVarintLen64]byte |
| 1705 | i := binary.PutVarint(scratch[:binary.MaxVarintLen64], x) |
| 1706 | return append(appendTo, scratch[:i]...) |
| 1707 | } |
| 1708 | |
| 1709 | // DecodeNonsortingStdlibVarint decodes a value encoded by EncodeNonsortingVarint. It |
| 1710 | // returns the length of the encoded varint and value. |
no outgoing calls
no test coverage detected
searching dependent graphs…