Skip to content

Commit

Permalink
Merge commit 'e1f73c4' into bcg_buffer_perf
Browse files Browse the repository at this point in the history
  • Loading branch information
bcg committed Sep 13, 2011
2 parents e0a9fd8 + e1f73c4 commit 0ec1ed7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/em-mongo/server_response.rb
Expand Up @@ -21,10 +21,14 @@ def initialize(buffer, connection)
@number_returned = buffer.get_int

# Documents
@docs = (1..number_returned).map do
pos=buffer.position
@docs = (1..@number_returned).map do
size= @connection.peek_size(buffer)
buf = buffer.get(size)
BSON::BSON_CODER.deserialize(buf)

doc=CBson.deserialize(buffer.to_s[pos,size])
pos+=size
buffer.position=pos
doc
end
end

Expand Down

0 comments on commit 0ec1ed7

Please sign in to comment.