summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-08-20 16:18:50 -0400
committerEliot Horowitz <eliot@10gen.com>2009-08-20 16:18:50 -0400
commit48f47865da8ab436ae1a6f2c10fdf7350085b216 (patch)
tree438ae243efd8c202775661f56a97d81a98f547d0
parent20fc44edfbf8816c7d08f6ac3380d42706ca51bc (diff)
downloadmongo-48f47865da8ab436ae1a6f2c10fdf7350085b216.tar.gz
formatting
-rw-r--r--db/queryutil.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/db/queryutil.cpp b/db/queryutil.cpp
index 4a99736ddac..2f7a2acf79a 100644
--- a/db/queryutil.cpp
+++ b/db/queryutil.cpp
@@ -23,7 +23,7 @@
#include "queryoptimizer.h"
namespace mongo {
-
+
FieldRange::FieldRange( const BSONElement &e, bool optimize ) {
lower() = minKey.firstElement();
lowerInclusive() = true;
@@ -41,49 +41,49 @@ namespace mongo {
return;
}
switch( e.getGtLtOp() ) {
- case BSONObj::Equality:
- lower() = e;
- upper() = e;
- break;
- case BSONObj::LT:
- upperInclusive() = false;
- case BSONObj::LTE:
- upper() = e;
- break;
- case BSONObj::GT:
- lowerInclusive() = false;
- case BSONObj::GTE:
- lower() = e;
- break;
+ case BSONObj::Equality:
+ lower() = e;
+ upper() = e;
+ break;
+ case BSONObj::LT:
+ upperInclusive() = false;
+ case BSONObj::LTE:
+ upper() = e;
+ break;
+ case BSONObj::GT:
+ lowerInclusive() = false;
+ case BSONObj::GTE:
+ lower() = e;
+ break;
case BSONObj::opALL: {
massert( "$all requires array", e.type() == Array );
- BSONObjIterator i( e.embeddedObject() );
- if ( i.moreWithEOO() ) {
- BSONElement f = i.next();
- if ( !f.eoo() )
- lower() = upper() = f;
- }
- break;
+ BSONObjIterator i( e.embeddedObject() );
+ if ( i.moreWithEOO() ) {
+ BSONElement f = i.next();
+ if ( !f.eoo() )
+ lower() = upper() = f;
+ }
+ break;
}
case BSONObj::opIN: {
- massert( "$in requires array", e.type() == Array );
- BSONElement max = minKey.firstElement();
- BSONElement min = maxKey.firstElement();
- BSONObjIterator i( e.embeddedObject() );
- while( i.moreWithEOO() ) {
- BSONElement f = i.next();
- if ( f.eoo() )
- break;
- if ( max.woCompare( f, false ) < 0 )
- max = f;
- if ( min.woCompare( f, false ) > 0 )
- min = f;
- }
- lower() = min;
- upper() = max;
+ massert( "$in requires array", e.type() == Array );
+ BSONElement max = minKey.firstElement();
+ BSONElement min = maxKey.firstElement();
+ BSONObjIterator i( e.embeddedObject() );
+ while( i.moreWithEOO() ) {
+ BSONElement f = i.next();
+ if ( f.eoo() )
+ break;
+ if ( max.woCompare( f, false ) < 0 )
+ max = f;
+ if ( min.woCompare( f, false ) > 0 )
+ min = f;
}
- default:
- break;
+ lower() = min;
+ upper() = max;
+ }
+ default:
+ break;
}
if ( optimize ){