Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove pack/unpack overhead

  • Loading branch information...
commit 6932aa644239414a7d7c32fb0fd923e3efcfe51e 1 parent f806c48
@christophsturm christophsturm authored committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/em-mongo/connection.rb
View
4 lib/em-mongo/connection.rb
@@ -154,7 +154,7 @@ def peek_size(buffer)
def receive_data(data)
- @buffer.append!(BSON::ByteBuffer.new(data.unpack('C*')))
+ @buffer.append!(data)
@buffer.rewind
while message_received?(@buffer)
@@ -165,7 +165,7 @@ def receive_data(data)
if @buffer.more?
remaining_bytes= @buffer.size-@buffer.position
- @buffer = BSON::ByteBuffer.new(@buffer.get(remaining_bytes))
+ @buffer = BSON::ByteBuffer.new(@buffer.to_s[@buffer.position,remaining_bytes])
@buffer.rewind
else
@buffer.clear
Please sign in to comment.
Something went wrong with that request. Please try again.