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

Add const

This commit is contained in:
Aaron 2009-02-25 16:03:09 -05:00
parent 181a200309
commit c7cc5c6b4b
3 changed files with 9 additions and 9 deletions

View File

@ -296,7 +296,7 @@ namespace mongo {
extern DiskLoc minDiskLoc;
bool BtreeBucket::exists(IndexDetails& idx, DiskLoc thisLoc, BSONObj& key, BSONObj order) {
bool BtreeBucket::exists(const IndexDetails& idx, DiskLoc thisLoc, BSONObj& key, BSONObj order) {
int pos;
bool found;
DiskLoc b = locate(idx, thisLoc, key, order, pos, found, minDiskLoc);
@ -328,7 +328,7 @@ namespace mongo {
note result might be an Unused location!
*/
char foo;
bool BtreeBucket::find(IndexDetails& idx, BSONObj& key, DiskLoc recordLoc, const BSONObj &order, int& pos, bool assertIfDup) {
bool BtreeBucket::find(const IndexDetails& idx, BSONObj& key, DiskLoc recordLoc, const BSONObj &order, int& pos, bool assertIfDup) {
#if defined(_EXPERIMENT1)
{
char *z = (char *) this;
@ -704,7 +704,7 @@ found:
return DiskLoc();
}
DiskLoc BtreeBucket::locate(IndexDetails& idx, const DiskLoc& thisLoc, BSONObj& key, const BSONObj &order, int& pos, bool& found, DiskLoc recordLoc, int direction) {
DiskLoc BtreeBucket::locate(const IndexDetails& idx, const DiskLoc& thisLoc, BSONObj& key, const BSONObj &order, int& pos, bool& found, DiskLoc recordLoc, int direction) {
int p;
found = find(idx, key, recordLoc, order, p, /*assertIfDup*/ false);
if ( found ) {

View File

@ -160,7 +160,7 @@ namespace mongo {
public:
void dump();
bool exists(IndexDetails& idx, DiskLoc thisLoc, BSONObj& key, BSONObj order);
bool exists(const IndexDetails& idx, DiskLoc thisLoc, BSONObj& key, BSONObj order);
static DiskLoc addHead(IndexDetails&); /* start a new index off, empty */
@ -173,7 +173,7 @@ namespace mongo {
/* locate may return an "unused" key that is just a marker. so be careful.
looks for a key:recordloc pair.
*/
DiskLoc locate(IndexDetails& , const DiskLoc& thisLoc, BSONObj& key, const BSONObj &order,
DiskLoc locate(const IndexDetails& , const DiskLoc& thisLoc, BSONObj& key, const BSONObj &order,
int& pos, bool& found, DiskLoc recordLoc, int direction=1);
/* advance one key position in the index: */
@ -198,7 +198,7 @@ namespace mongo {
int _insert(DiskLoc thisLoc, DiskLoc recordLoc,
BSONObj& key, const BSONObj &order, bool dupsAllowed,
DiskLoc lChild, DiskLoc rChild, IndexDetails&);
bool find(IndexDetails& idx, BSONObj& key, DiskLoc recordLoc, const BSONObj &order, int& pos, bool assertIfDup);
bool find(const IndexDetails& idx, BSONObj& key, DiskLoc recordLoc, const BSONObj &order, int& pos, bool assertIfDup);
static void findLargestKey(const DiskLoc& thisLoc, DiskLoc& largestLoc, int& largestKey);
};
@ -207,7 +207,7 @@ namespace mongo {
BSONObj startKey;
BSONObj endKey;
public:
BtreeCursor( IndexDetails&, const BSONObj &startKey, const BSONObj &endKey, int direction );
BtreeCursor( const IndexDetails&, const BSONObj &startKey, const BSONObj &endKey, int direction );
virtual bool ok() {
return !bucket.isNull();
}
@ -273,7 +273,7 @@ namespace mongo {
/* Check if the current key is beyond endKey. */
void checkEnd();
IndexDetails& indexDetails;
const IndexDetails& indexDetails;
BSONObj order;
DiskLoc bucket;
int keyOfs;

View File

@ -28,7 +28,7 @@ namespace mongo {
DiskLoc maxDiskLoc(0x7fffffff, 0x7fffffff);
DiskLoc minDiskLoc(0, 1);
BtreeCursor::BtreeCursor( IndexDetails &_id, const BSONObj &_startKey, const BSONObj &_endKey, int _direction ) :
BtreeCursor::BtreeCursor( const IndexDetails &_id, const BSONObj &_startKey, const BSONObj &_endKey, int _direction ) :
startKey( _startKey ),
endKey( _endKey ),
indexDetails( _id ),