MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / EncodeBitArrayAscending

Function EncodeBitArrayAscending

pkg/util/encoding/encoding.go:1126–1135  ·  view source on GitHub ↗

EncodeBitArrayAscending encodes a bitarray.BitArray value, appends it to the supplied buffer, and returns the final buffer. The encoding is guaranteed to be ordered such that if t1.Compare(t2) < 0 (or = 0 or > 0) then bytes.Compare will order them the same way after encoding. The encoding uses vari

(b []byte, d bitarray.BitArray)

Source from the content-addressed store, hash-verified

1124// In contrast, the chosen encoding using varints is endianness-agnostic
1125// and enables fast decoding/skipping thanks ot the tag bytes.
1126func EncodeBitArrayAscending(b []byte, d bitarray.BitArray) []byte {
1127 b = append(b, bitArrayMarker)
1128 words, lastBitsUsed := d.EncodingParts()
1129 for _, w := range words {
1130 b = EncodeUvarintAscending(b, w)
1131 }
1132 b = append(b, bitArrayDataTerminator)
1133 b = EncodeUvarintAscending(b, lastBitsUsed)
1134 return b
1135}
1136
1137// EncodeBitArrayDescending is the descending version of EncodeBitArrayAscending.
1138func EncodeBitArrayDescending(b []byte, d bitarray.BitArray) []byte {

Callers

nothing calls this directly

Calls 2

EncodeUvarintAscendingFunction · 0.85
EncodingPartsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…