Skip to content

Commit 6194f41

Browse files
committed
Improved code
1 parent 15b03ac commit 6194f41

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/pgvector/vector.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def to_binary
3232
if numo?(@data)
3333
[@data.shape[0], 0].pack("s>s>") + @data.to_network.to_binary
3434
else
35-
[@data.size, 0].pack("s>s>") + @data.pack("g*")
35+
buffer = [@data.size, 0].pack("s>s>")
36+
@data.pack("g*", buffer: buffer)
37+
buffer
3638
end
3739
end
3840

0 commit comments

Comments
 (0)