0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

more const

This commit is contained in:
Dwight 2010-08-23 11:45:32 -04:00
parent 22aa421d98
commit 857bd9b4dc
3 changed files with 8 additions and 8 deletions

View File

@ -138,17 +138,18 @@ namespace mongo {
/*const*/ CursorId cursorid;
const string ns;
const shared_ptr<Cursor> c;
int pos; // # objects into the cursor so far
BSONObj query;
int pos; // # objects into the cursor so far
const BSONObj query; // used for logging diags only; optional in constructor
const int _queryOptions; // see enum QueryOptions dbclient.h
OpTime _slaveReadTill;
Database * const _db;
ClientCursor(int queryOptions, shared_ptr<Cursor>& _c, const string& _ns) :
ClientCursor(int queryOptions, shared_ptr<Cursor>& _c, const string& _ns, BSONObj _query = BSONObj()) :
_idleAgeMillis(0), _pinValue(0),
_doingDeletes(false), _yieldSometimesTracker(128,10),
ns(_ns), c(_c),
pos(0), _queryOptions(queryOptions),
pos(0), query(_query),
_queryOptions(queryOptions),
_db( cc().database() )
{
assert( _db );

View File

@ -195,7 +195,7 @@ namespace mongo {
// Use a ClientCursor here so we can release db mutex while scanning
// oplog (can take quite a while with large oplogs).
shared_ptr<Cursor> c = _qp.newReverseCursor();
_findingStartCursor = new ClientCursor(QueryOption_NoCursorTimeout, c, _qp.ns());
_findingStartCursor = new ClientCursor(QueryOption_NoCursorTimeout, c, _qp.ns(), BSONObj());
_findingStartTimer.reset();
_findingStartMode = Initial;
BSONElement tsElt = _qp.originalQuery()[ "ts" ];

View File

@ -1063,13 +1063,12 @@ namespace mongo {
if ( moreClauses ) {
// this MultiCursor will use a dumb NoOp to advance(), so no need to specify mayYield
shared_ptr< Cursor > multi( new MultiCursor( mps, cursor, dqo.matcher(), dqo ) );
cc = new ClientCursor(queryOptions, multi, ns);
cc = new ClientCursor(queryOptions, multi, ns, jsobj.getOwned());
} else {
cursor->setMatcher( dqo.matcher() );
cc = new ClientCursor( queryOptions, cursor, ns );
cc = new ClientCursor( queryOptions, cursor, ns, jsobj.getOwned() );
}
cursorid = cc->cursorid;
cc->query = jsobj.getOwned();
DEV tlog(2) << "query has more, cursorid: " << cursorid << endl;
cc->pos = n;
cc->pq = pq_shared;