Skip to content

Commit

Permalink
fix batchSize
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Jul 29, 2010
1 parent 02a8ce1 commit babe893
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions client/dbclientcursor.cpp
Expand Up @@ -28,14 +28,10 @@ namespace mongo {

int DBClientCursor::nextBatchSize(){

if ( nToReturn == 0 ){
if ( batchSize > 1 )
return batchSize;
else
return 0;
}
if ( nToReturn == 0 )
return batchSize;

if ( batchSize <= 1 )
if ( batchSize == 0 )
return nToReturn;

return batchSize < nToReturn ? batchSize : nToReturn;
Expand Down
2 changes: 1 addition & 1 deletion client/dbclientcursor.h
Expand Up @@ -117,7 +117,7 @@ namespace mongo {
nToSkip(_nToSkip),
fieldsToReturn(_fieldsToReturn),
opts(queryOptions),
batchSize(bs),
batchSize(bs==1?2:bs),
m(new Message()),
cursorId(),
nReturned(),
Expand Down

0 comments on commit babe893

Please sign in to comment.