Optimize ByteBuffer#get_int.

This commit is contained in:
Hongli Lai (Phusion) 2010-09-11 19:36:05 +02:00 committed by Kyle Banker
parent 026e409d6d
commit 1c25541492
1 changed files with 1 additions and 2 deletions

View File

@ -173,8 +173,7 @@ module BSON
def get_int
check_read_length(4)
vals = ""
(@cursor..@cursor+3).each { |i| vals << buf[i].chr }
vals = buf[@cursor..@cursor+3].pack("C*")
@cursor += 4
vals.unpack(@int_pack_order)[0]
end