MCPcopy Create free account
hub / github.com/dolthub/doltgresql / DecodeNonsortingStdlibUvarint

Function DecodeNonsortingStdlibUvarint

postgres/parser/encoding/encoding.go:860–868  ·  view source on GitHub ↗

DecodeNonsortingStdlibUvarint decodes a value encoded with binary.PutUvarint. It returns the length of the encoded varint and value.

(
	buf []byte,
)

Source from the content-addressed store, hash-verified

858// DecodeNonsortingStdlibUvarint decodes a value encoded with binary.PutUvarint. It
859// returns the length of the encoded varint and value.
860func DecodeNonsortingStdlibUvarint(
861 buf []byte,
862) (remaining []byte, length int, value uint64, err error) {
863 i, n := binary.Uvarint(buf)
864 if n <= 0 {
865 return buf, 0, 0, errors.New("buffer too small")
866 }
867 return buf[n:], n, i, nil
868}
869
870// EncodeUntaggedDecimalValue encodes an apd.Decimal value, appends it to the supplied
871// buffer, and returns the final buffer.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected