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:
parent
77155b2923
commit
a9f50f1930
@ -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 );
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user