Skip to content

Commit

Permalink
Improved code
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Jul 15, 2024
1 parent 7f412c4 commit 15b03ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pgvector/bit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def self.from_text(string)
end

def self.from_binary(string)
length = string[..3].unpack1("l>")
Bit.new(string[4..].unpack("B*").join[...length])
length, data = string.unpack("l>B*")
Bit.new(data[...length])
end

def to_s
Expand Down

0 comments on commit 15b03ac

Please sign in to comment.