minor: bson deserialize fix

This commit is contained in:
Kyle Banker 2010-05-31 23:11:02 -04:00
parent a7e2991c31
commit aa70597a67
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ module BSON
def self.deserialize(buf=nil) def self.deserialize(buf=nil)
if buf.is_a? String if buf.is_a? String
buf = ByteBuffer.new(buf) if buf buf = ByteBuffer.new(buf.unpack("C*")) if buf
else else
buf = ByteBuffer.new(buf.to_a) if buf buf = ByteBuffer.new(buf.to_a) if buf
end end

View File

@ -175,7 +175,7 @@ module BSON
# If buf is nil, use @buf, assumed to contain already-serialized BSON. # If buf is nil, use @buf, assumed to contain already-serialized BSON.
# This is only true during testing. # This is only true during testing.
if buf.is_a? String if buf.is_a? String
@buf = ByteBuffer.new(buf) if buf @buf = ByteBuffer.new(buf.unpack("C*")) if buf
else else
@buf = ByteBuffer.new(buf.to_a) if buf @buf = ByteBuffer.new(buf.to_a) if buf
end end