diff --git a/db/queryutil.cpp b/db/queryutil.cpp index f81beade4ef..4d45a3b6326 100644 --- a/db/queryutil.cpp +++ b/db/queryutil.cpp @@ -91,7 +91,7 @@ namespace mongo { } } - FieldBound &FieldBound::operator&=( const FieldBound &other ) { + const FieldBound &FieldBound::operator&=( const FieldBound &other ) { if ( other.upper_.woCompare( upper_, false ) < 0 ) upper_ = other.upper_; if ( other.lower_.woCompare( lower_, false ) > 0 ) diff --git a/db/queryutil.h b/db/queryutil.h index 5d98aacb5c5..a1533f6d004 100644 --- a/db/queryutil.h +++ b/db/queryutil.h @@ -31,7 +31,7 @@ namespace mongo { class FieldBound { public: FieldBound( const BSONElement &e = emptyObj.firstElement() ); - FieldBound &operator&=( const FieldBound &other ); + const FieldBound &operator&=( const FieldBound &other ); BSONElement lower() const { return lower_; } BSONElement upper() const { return upper_; } bool equality() const { return lower_.woCompare( upper_, false ) == 0; }