MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / PutUint32Ascending

Function PutUint32Ascending

pkg/util/encoding/encoding.go:212–221  ·  view source on GitHub ↗

PutUint32Ascending encodes the uint32 value using a big-endian 4 byte representation at the specified index, lengthening the input slice if necessary.

(b []byte, v uint32, idx int)

Source from the content-addressed store, hash-verified

210// representation at the specified index, lengthening the input slice if
211// necessary.
212func PutUint32Ascending(b []byte, v uint32, idx int) []byte {
213 for len(b) < idx+4 {
214 b = append(b, 0)
215 }
216 b[idx] = byte(v >> 24)
217 b[idx+1] = byte(v >> 16)
218 b[idx+2] = byte(v >> 8)
219 b[idx+3] = byte(v)
220 return b
221}
222
223// EncodeUint32Descending encodes the uint32 value so that it sorts in
224// reverse order, from largest to smallest.

Callers 5

encodeMethod · 0.92
encodeMethod · 0.92
EncodeJSONFunction · 0.92
EncodeTSQueryFunction · 0.92
EncodeTSQueryPGBinaryFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…