From 039484c26332ac43c50d3df4029a05b992446d2c Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Mon, 16 Nov 2009 10:40:16 -0500 Subject: [PATCH] minor: fixes for benchmarks and byte buffer defaults --- bin/standard_benchmark | 5 ++++- lib/mongo/util/byte_buffer.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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'