minor: bson deserialize fix
This commit is contained in:
parent
a7e2991c31
commit
aa70597a67
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user