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

Method VariableInt

utils/writer.go:134–137  ·  view source on GitHub ↗

VariableInt writes an int64 using variable-length encoding. Smaller values use less space at the cost of larger values using more bytes, but this is generally more space-efficient. This does carry a small computational hit when reading.

(val int64)

Source from the content-addressed store, hash-verified

132// values using more bytes, but this is generally more space-efficient. This does carry a small computational hit when
133// reading.
134func (writer *Writer) VariableInt(val int64) {
135 count := binary.PutVarint(writer.numSlice, val)
136 writer.buf.Write(writer.numSlice[:count])
137}
138
139// VariableUint writes a uint64 using variable-length encoding. Smaller values use less space at the cost of larger
140// values using more bytes, but this is generally more space-efficient. This does carry a small computational hit when

Callers 2

TestWriterReaderFunction · 0.95
VariableIntSliceMethod · 0.95

Calls 1

WriteMethod · 0.45

Tested by 1

TestWriterReaderFunction · 0.76