diff --git a/bin/standard_benchmark b/bin/standard_benchmark index 2cc706f..b63a1cd 100755 --- a/bin/standard_benchmark +++ b/bin/standard_benchmark @@ -1,8 +1,11 @@ #!/usr/bin/env ruby +#$LOAD_PATH[0,0] = File.join(File.dirname(__FILE__), '..', 'lib') # # Note: Ruby 1.9 is faster than 1.8, as expected. +# This suite will be run again the installed version of ruby-mongo-driver. +# The c-extension, mongo_ext, will be used if installed. -$LOAD_PATH[0,0] = File.join(File.dirname(__FILE__), '..', 'lib') +require 'rubygems' require 'mongo' include Mongo diff --git a/lib/mongo/util/byte_buffer.rb b/lib/mongo/util/byte_buffer.rb index 707702a..b852ba4 100644 --- a/lib/mongo/util/byte_buffer.rb +++ b/lib/mongo/util/byte_buffer.rb @@ -21,7 +21,7 @@ class ByteBuffer def initialize(initial_data=[]) @buf = initial_data - @cursor = 0 + @cursor = @buf.length @order = :little_endian @int_pack_order = 'V' @double_pack_order = 'E'