RUBY-180 fixed failing test

This commit is contained in:
Kyle Banker 2010-09-09 14:53:29 -04:00
parent d0e97a2863
commit 3a4134a5c2
1 changed files with 6 additions and 6 deletions

View File

@ -363,12 +363,12 @@ module Mongo
BSON::BSON_RUBY.serialize_cstr(message, "#{@db.name}.#{@collection.name}") BSON::BSON_RUBY.serialize_cstr(message, "#{@db.name}.#{@collection.name}")
# Number of results to return. # Number of results to return.
if @limit if @limit > 0
if (@returned + @batch_size) > @limit limit = @limit - @returned
message.put_int(@limit - @returned) if @batch_size > 0
else limit = limit < @batch_size ? limit : @batch_size
message.put_int(@batch_size)
end end
message.put_int(limit)
else else
message.put_int(@batch_size) message.put_int(@batch_size)
end end
@ -438,7 +438,7 @@ module Mongo
end end
def close_cursor_if_query_complete def close_cursor_if_query_complete
if @limit > 0 && @n_received >= @limit if @limit > 0 && @returned >= @limit
close close
end end
end end