We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16e2104 commit 81f2e4eCopy full SHA for 81f2e4e
bson/vector.go
@@ -161,8 +161,10 @@ func binaryFromFloat32Vector(v []float32) Binary {
161
}
162
163
func binaryFromBitVector(bits []byte, padding uint8) Binary {
164
- data := []byte{PackedBitVector, padding}
165
- data = append(data, bits...)
+ data := make([]byte, len(bits)+2)
+ data[0] = PackedBitVector
166
+ data[1] = byte(padding)
167
+ copy(data[2:], bits)
168
return Binary{
169
Subtype: TypeBinaryVector,
170
Data: data,
0 commit comments