From a6d055026c3a13b423e099e9d080256ac040f706 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Thu, 23 May 2013 00:04:19 -0400 Subject: SERVER-6400: remove _allHaveTomatch since it was never used --- src/mongo/db/matcher/expression_leaf.cpp | 17 +++-------------- src/mongo/db/matcher/expression_leaf.h | 6 ++---- 2 files changed, 5 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/mongo/db/matcher/expression_leaf.cpp b/src/mongo/db/matcher/expression_leaf.cpp index a470661171d..db3c819cbbe 100644 --- a/src/mongo/db/matcher/expression_leaf.cpp +++ b/src/mongo/db/matcher/expression_leaf.cpp @@ -109,17 +109,10 @@ namespace mongo { } if ( found ) { - if ( !_allHaveToMatch ) { - if ( details && details->needRecord() ) { - // this block doesn't have to be inside the _allHaveToMatch handler - // but this matches the old semantics - details->setElemMatchKey( x.fieldName() ); - } - return true; + if ( details && details->needRecord() ) { + details->setElemMatchKey( x.fieldName() ); } - } - else if ( _allHaveToMatch ) { - return false; + return true; } } @@ -163,7 +156,6 @@ namespace mongo { case EQ: case GT: case GTE: - _allHaveToMatch = false; break; default: return Status( ErrorCodes::BadValue, "bad match type for ComparisonMatchExpression" ); @@ -411,8 +403,6 @@ namespace mongo { if ( found ) { if ( details && details->needRecord() ) { - // this block doesn't have to be inside the _allHaveToMatch handler - // but this matches the old semantics details->setElemMatchKey( x.fieldName() ); } return true; @@ -501,7 +491,6 @@ namespace mongo { void InMatchExpression::init( const StringData& path ) { initPath( path ); - _allHaveToMatch = false; } bool InMatchExpression::_matchesRealElement( const BSONElement& e ) const { diff --git a/src/mongo/db/matcher/expression_leaf.h b/src/mongo/db/matcher/expression_leaf.h index f29a3c09d08..1f4501bedc7 100644 --- a/src/mongo/db/matcher/expression_leaf.h +++ b/src/mongo/db/matcher/expression_leaf.h @@ -30,8 +30,8 @@ namespace mongo { class LeafMatchExpression : public MatchExpression { public: - LeafMatchExpression( MatchType matchType ) : MatchExpression( matchType ) { - _allHaveToMatch = false; + LeafMatchExpression( MatchType matchType ) + : MatchExpression( matchType ) { } virtual ~LeafMatchExpression(){} @@ -43,11 +43,9 @@ namespace mongo { virtual bool matchesSingleElement( const BSONElement& e ) const = 0; const StringData path() const { return _path; } - bool allHaveToMatch() const { return _allHaveToMatch; } protected: void initPath( const StringData& path ); - bool _allHaveToMatch; private: bool _matches( const FieldRef& fieldRef, -- cgit v1.2.1