Skip to content

Commit

Permalink
Detect NULLs in a way consisent with rest of code
Browse files Browse the repository at this point in the history
  • Loading branch information
bjeanes committed Mar 26, 2017
1 parent 39f05b8 commit aa24fb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pg/decoder.cr
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ module PG
# return String.new(ByteaDecoder.new.decode(io,bytesize))
Hash(String, String?).new.tap do |hash|
string_decoder = StringDecoder.new
key_count = read_u32(io)
key_count = read_u32(io) # 4
key_count.times do
length = read_u32(io)
length = read_u32(io) # 4
key = string_decoder.decode(io, length)
length = read_u32(io)
if length == UInt32::MAX
if length == -1
hash[key] = nil
else
value = string_decoder.decode(io, length)
Expand Down

0 comments on commit aa24fb6

Please sign in to comment.