Skip to content

Commit 81f2e4e

Browse files
committed
minor update
1 parent 16e2104 commit 81f2e4e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bson/vector.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ func binaryFromFloat32Vector(v []float32) Binary {
161161
}
162162

163163
func binaryFromBitVector(bits []byte, padding uint8) Binary {
164-
data := []byte{PackedBitVector, padding}
165-
data = append(data, bits...)
164+
data := make([]byte, len(bits)+2)
165+
data[0] = PackedBitVector
166+
data[1] = byte(padding)
167+
copy(data[2:], bits)
166168
return Binary{
167169
Subtype: TypeBinaryVector,
168170
Data: data,

0 commit comments

Comments
 (0)