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

Method VariableInt

utils/reader.go:118–126  ·  view source on GitHub ↗

VariableInt reads an int64 that was written using variable-length encoding.

()

Source from the content-addressed store, hash-verified

116
117// VariableInt reads an int64 that was written using variable-length encoding.
118func (reader *Reader) VariableInt() int64 {
119 uval := reader.VariableUint()
120 // binary.PutVarint performs the inverse of this and writes a uint64, so we're undoing it to get the original int64
121 val := int64(uval >> 1)
122 if uval&1 != 0 {
123 val = ^val
124 }
125 return val
126}
127
128// VariableUint reads a uint64 that was written using variable-length encoding.
129func (reader *Reader) VariableUint() uint64 {

Callers 2

VariableIntSliceMethod · 0.95
TestWriterReaderFunction · 0.95

Calls 1

VariableUintMethod · 0.95

Tested by 1

TestWriterReaderFunction · 0.76