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

FieldRangeSet::trivialRange() should return a const reference

This commit is contained in:
Aaron 2011-04-25 15:18:05 -07:00
parent 77155b2923
commit a9f50f1930
2 changed files with 2 additions and 2 deletions

View File

@ -878,7 +878,7 @@ namespace mongo {
FieldRange *FieldRangeSet::__singleKeyTrivialRange = 0;
FieldRange *FieldRangeSet::__multiKeyTrivialRange = 0;
FieldRange &FieldRangeSet::trivialRange() const {
const FieldRange &FieldRangeSet::trivialRange() const {
FieldRange *&ret = _singleKey ? __singleKeyTrivialRange : __multiKeyTrivialRange;
if ( ret == 0 ) {
ret = new FieldRange( BSONObj().firstElement(), _singleKey, false, true );

View File

@ -207,7 +207,7 @@ namespace mongo {
void processOpElement( const char *fieldName, const BSONElement &f, bool isNot, bool optimize );
static FieldRange *__singleKeyTrivialRange;
static FieldRange *__multiKeyTrivialRange;
FieldRange &trivialRange() const;
const FieldRange &trivialRange() const;
map<string,FieldRange> _ranges;
const char *_ns;
// Owns memory for FieldRange BSONElements.