diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-06-09 11:43:04 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-06-09 11:43:04 -0400 |
commit | 00df88c21d12a230550dc250fb20fde0f1aedf26 (patch) | |
tree | 027bdafe3b99d8bd32d814d7b775262b6eb20920 | |
parent | a525339af5c8ea2cc670fada418f3ea0f255f4e0 (diff) | |
download | mongo-00df88c21d12a230550dc250fb20fde0f1aedf26.tar.gz |
moved BSONObjIterator::more to BSONObjectIteratore::moreWEOO()
added _more temporarily
SERVER-101
-rw-r--r-- | client/dbclient.cpp | 4 | ||||
-rw-r--r-- | db/cloner.cpp | 4 | ||||
-rw-r--r-- | db/jsobj.cpp | 32 | ||||
-rw-r--r-- | db/jsobj.h | 11 | ||||
-rw-r--r-- | db/jsobjmanipulator.h | 2 | ||||
-rw-r--r-- | db/matcher.cpp | 18 | ||||
-rw-r--r-- | db/pdfile.cpp | 10 | ||||
-rw-r--r-- | db/query.cpp | 12 | ||||
-rw-r--r-- | db/queryoptimizer.cpp | 10 | ||||
-rw-r--r-- | db/queryutil.cpp | 10 | ||||
-rw-r--r-- | db/queryutil.h | 2 | ||||
-rw-r--r-- | db/repl.cpp | 6 | ||||
-rw-r--r-- | dbtests/jsobjtests.cpp | 8 | ||||
-rw-r--r-- | s/config.cpp | 6 | ||||
-rw-r--r-- | s/cursors.cpp | 4 | ||||
-rw-r--r-- | s/shard.cpp | 4 | ||||
-rw-r--r-- | s/shardkey.cpp | 2 | ||||
-rw-r--r-- | scripting/engine_spidermonkey.cpp | 9 |
18 files changed, 74 insertions, 80 deletions
diff --git a/client/dbclient.cpp b/client/dbclient.cpp index 1da8c5cf1b4..92e78fe835c 100644 --- a/client/dbclient.cpp +++ b/client/dbclient.cpp @@ -530,10 +530,8 @@ namespace mongo { stringstream ss; bool first = 1; - for ( BSONObjIterator i(keys); i.more(); ) { + for ( BSONObjIterator i(keys); i._more(); ) { BSONElement f = i.next(); - if ( f.eoo() ) - break; if ( first ) first = 0; diff --git a/db/cloner.cpp b/db/cloner.cpp index c44ed32d3be..0a83669255f 100644 --- a/db/cloner.cpp +++ b/db/cloner.cpp @@ -58,7 +58,7 @@ namespace mongo { BSONObj fixindex(BSONObj o) { BSONObjBuilder b; BSONObjIterator i(o); - while ( i.more() ) { + while ( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -612,7 +612,7 @@ namespace mongo { BSONObj o = c->next(); BSONObjBuilder b; BSONObjIterator i( o ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; diff --git a/db/jsobj.cpp b/db/jsobj.cpp index ece58222ab8..426665f587b 100644 --- a/db/jsobj.cpp +++ b/db/jsobj.cpp @@ -593,7 +593,7 @@ namespace mongo { BSONObjIterator i(*this); bool first = true; while ( 1 ) { - massert( "Object does not end with EOO", i.more() ); + massert( "Object does not end with EOO", i.moreWithEOO() ); BSONElement e = i.next( true ); massert( "Invalid element size", e.size() > 0 ); massert( "Element too large", e.size() < ( 1 << 30 ) ); @@ -718,7 +718,7 @@ namespace mongo { BSONElement BSONObj::getField(const char *name) const { BSONObjIterator i(*this); - while ( i.more() ) { + while ( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -760,7 +760,7 @@ namespace mongo { if ( e.type() == Array ) { trueDat( deep ); BSONObjIterator i( e.embeddedObject() ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement f = i.next(); if ( f.eoo() ) break; @@ -775,7 +775,7 @@ namespace mongo { if ( e.type() == Array ) { trueDat( deep ); BSONObjIterator i( e.embeddedObject() ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement f = i.next(); if ( f.eoo() ) break; @@ -821,7 +821,7 @@ namespace mongo { BSONObj BSONObj::extractFieldsDotted(BSONObj pattern, BSONObjBuilder& b, const char *&nameWithinArray) const { nameWithinArray = ""; BSONObjIterator i(pattern); - while ( i.more() ) { + while ( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -847,7 +847,7 @@ namespace mongo { BSONObj BSONObj::extractFieldsUnDotted(BSONObj pattern) const { BSONObjBuilder b; BSONObjIterator i(pattern); - while ( i.more() ) { + while ( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -861,7 +861,7 @@ namespace mongo { BSONObj BSONObj::extractFields(const BSONObj& pattern) const { BSONObjBuilder b(32); // scanandorder.h can make a zillion of these, so we start the allocation very small BSONObjIterator i(pattern); - while ( i.more() ) { + while ( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -876,7 +876,7 @@ namespace mongo { BSONObj BSONObj::filterFieldsUndotted( const BSONObj &filter, bool inFilter ) const { BSONObjBuilder b; BSONObjIterator i( *this ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -891,7 +891,7 @@ namespace mongo { BSONElement BSONObj::getFieldUsingIndexNames(const char *fieldName, const BSONObj &indexKey) const { BSONObjIterator i( indexKey ); int j = 0; - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement f = i.next(); if ( f.eoo() ) return BSONElement(); @@ -900,7 +900,7 @@ namespace mongo { ++j; } BSONObjIterator k( *this ); - while( k.more() ) { + while( k.moreWithEOO() ) { BSONElement g = k.next(); if ( g.eoo() ) return BSONElement(); @@ -936,7 +936,7 @@ namespace mongo { int BSONObj::nFields() const { int n = 0; BSONObjIterator i(*this); - while ( i.more() ) { + while ( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -949,7 +949,7 @@ namespace mongo { int BSONObj::getFieldNames(set<string>& fields) const { int n = 0; BSONObjIterator i(*this); - while ( i.more() ) { + while ( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -971,7 +971,7 @@ namespace mongo { int n = 0; BSONObjIterator i(from); bool gotId = false; - while ( i.more() ) { + while ( i.moreWithEOO() ) { BSONElement e = i.next(); const char *fname = e.fieldName(); if ( fields.count(fname) ) { @@ -999,7 +999,7 @@ namespace mongo { BSONObj BSONObj::clientReadable() const { BSONObjBuilder b; BSONObjIterator i( *this ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -1027,8 +1027,8 @@ namespace mongo { BSONObjBuilder b; BSONObjIterator i( *this ); BSONObjIterator j( names ); - BSONElement f = j.more() ? j.next() : BSONObj().firstElement(); - while( i.more() ) { + BSONElement f = j.moreWithEOO() ? j.next() : BSONObj().firstElement(); + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; diff --git a/db/jsobj.h b/db/jsobj.h index 5b6ef989ac3..8bd354393c7 100644 --- a/db/jsobj.h +++ b/db/jsobj.h @@ -1227,9 +1227,12 @@ namespace mongo { theend = jso.objdata() + sz; } /** @return true if more elements exist to be enumerated. */ - bool more() { + bool moreWithEOO() { return pos < theend; } + bool _more(){ + return pos < theend && pos[0]; + } /** @return the next element in the object. For the final element, element.eoo() will be true. */ BSONElement next( bool checkEnd = false ) { assert( pos < theend ); @@ -1327,7 +1330,7 @@ namespace mongo { inline bool BSONObj::hasElement(const char *name) const { if ( !isEmpty() ) { BSONObjIterator it(*this); - while ( it.more() ) { + while ( it.moreWithEOO() ) { BSONElement e = it.next(); if ( strcmp(name, e.fieldName()) == 0 ) return true; @@ -1339,7 +1342,7 @@ namespace mongo { inline BSONElement BSONObj::findElement(const char *name) const { if ( !isEmpty() ) { BSONObjIterator it(*this); - while ( it.more() ) { + while ( it.moreWithEOO() ) { BSONElement e = it.next(); if ( strcmp(name, e.fieldName()) == 0 ) return e; @@ -1351,7 +1354,7 @@ namespace mongo { /* add all the fields from the object specified to this object */ inline BSONObjBuilder& BSONObjBuilder::appendElements(BSONObj x) { BSONObjIterator it(x); - while ( it.more() ) { + while ( it.moreWithEOO() ) { BSONElement e = it.next(); if ( e.eoo() ) break; append(e); diff --git a/db/jsobjmanipulator.h b/db/jsobjmanipulator.h index 0a7e0314c17..927e6fac860 100644 --- a/db/jsobjmanipulator.h +++ b/db/jsobjmanipulator.h @@ -54,7 +54,7 @@ public: // replacement policy is a work in progress. BSONObjIterator i( obj ); - for( int j = 0; i.more() && j < 2; ++j ) { + for( int j = 0; i.moreWithEOO() && j < 2; ++j ) { BSONElement e = i.next(); if ( e.eoo() ) break; diff --git a/db/matcher.cpp b/db/matcher.cpp index d4693563da8..3eff0beb9c3 100644 --- a/db/matcher.cpp +++ b/db/matcher.cpp @@ -138,7 +138,7 @@ namespace mongo { in(0), nin(0), all(0), where(0), jsobj(_jsobj), haveSize(), nRegex(0) { BSONObjIterator i(jsobj); - while ( i.more() ) { + while ( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -198,7 +198,7 @@ namespace mongo { // e.g., fe == { $gt : 3 } BSONObjIterator j(e.embeddedObject()); bool ok = false; - while ( j.more() ) { + while ( j.moreWithEOO() ) { BSONElement fe = j.next(); if ( fe.eoo() ) break; @@ -247,7 +247,7 @@ namespace mongo { uassert( "only 1 $in statement per query supported", in == 0 ); // todo... in = new set<BSONElement,element_lt>(); BSONObjIterator i(fe.embeddedObject()); - if ( i.more() ) { + if ( i.moreWithEOO() ) { while ( 1 ) { BSONElement ie = i.next(); if ( ie.eoo() ) @@ -263,7 +263,7 @@ namespace mongo { uassert( "only 1 $nin statement per query supported", nin == 0 ); // todo... nin = new set<BSONElement,element_lt>(); BSONObjIterator i(fe.embeddedObject()); - if ( i.more() ) { + if ( i.moreWithEOO() ) { while ( 1 ) { BSONElement ie = i.next(); if ( ie.eoo() ) @@ -279,7 +279,7 @@ namespace mongo { uassert( "only 1 $all statement per query supported", all == 0 ); // todo... all = new set<BSONElement,element_lt>(); BSONObjIterator i(fe.embeddedObject()); - if ( i.more() ) { + if ( i.moreWithEOO() ) { while ( 1 ) { BSONElement ie = i.next(); if ( ie.eoo() ) @@ -334,7 +334,7 @@ namespace mongo { return 0; int count = 0; BSONObjIterator i( l.embeddedObject() ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -348,7 +348,7 @@ namespace mongo { return 0; set< BSONElement, element_lt > matches; BSONObjIterator i( l.embeddedObject() ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -421,7 +421,7 @@ namespace mongo { if ( isArr ) { BSONObjIterator ai(obj); bool found = false; - while ( ai.more() ) { + while ( ai.moreWithEOO() ) { BSONElement z = ai.next(); if ( z.type() == Object ) { BSONObj eo = z.embeddedObject(); @@ -458,7 +458,7 @@ namespace mongo { return 1; } else if ( e.type() == Array && compareOp != BSONObj::opALL && compareOp != BSONObj::opSIZE ) { BSONObjIterator ai(e.embeddedObject()); - while ( ai.more() ) { + while ( ai.moreWithEOO() ) { BSONElement z = ai.next(); if ( valuesMatch( z, toMatch, compareOp) ) { if ( deep ) diff --git a/db/pdfile.cpp b/db/pdfile.cpp index 9326c958255..1806cc20959 100644 --- a/db/pdfile.cpp +++ b/db/pdfile.cpp @@ -663,7 +663,7 @@ assert( !eloc.isNull() ); BSONObjIterator keyIter( key ); BSONElement arrayElt; int arrayPos = -1; - for ( int i = 0; keyIter.more(); ++i ) { + for ( int i = 0; keyIter.moreWithEOO(); ++i ) { BSONElement e = keyIter.next(); if ( e.eoo() ) break; @@ -678,7 +678,7 @@ assert( !eloc.isNull() ); assert( strlen( nameWithinArray ) == 0 ); BSONObjBuilder b; BSONObjIterator keyIter( key ); - while ( keyIter.more() ) { + while ( keyIter.moreWithEOO() ) { BSONElement f = keyIter.next(); if ( f.eoo() ) break; @@ -691,7 +691,7 @@ assert( !eloc.isNull() ); } BSONObj arr = arrayElt.embeddedObject(); BSONObjIterator arrIter(arr); - while ( arrIter.more() ) { + while ( arrIter.moreWithEOO() ) { BSONElement e = arrIter.next(); if ( e.eoo() ) break; @@ -705,7 +705,7 @@ assert( !eloc.isNull() ); } BSONObjBuilder b; BSONObjIterator keyIter( key ); - for ( int i = 0; keyIter.more(); ++i ) { + for ( int i = 0; keyIter.moreWithEOO(); ++i ) { BSONElement f = keyIter.next(); if ( f.eoo() ) break; @@ -1128,7 +1128,7 @@ assert( !eloc.isNull() ); // should be { <something> : <simpletype[1|-1]>, .keyp.. } bool validKeyPattern(BSONObj kp) { BSONObjIterator i(kp); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if( e.type() == Object || e.type() == Array ) return false; diff --git a/db/query.cpp b/db/query.cpp index a6710657713..30152985a6c 100644 --- a/db/query.cpp +++ b/db/query.cpp @@ -403,7 +403,7 @@ namespace mongo { } BSONObjIterator i( top.embeddedObject() ); bool empty = true; - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -420,7 +420,7 @@ namespace mongo { BSONObjBuilder b; BSONObjIterator i( obj ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -451,7 +451,7 @@ namespace mongo { BSONObjBuilder arr( b2.subarrayStartAs( m->fieldName ) ); BSONObjIterator i( e.embeddedObject() ); int count = 0; - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement arrI = i.next(); if ( arrI.eoo() ) break; @@ -495,7 +495,7 @@ namespace mongo { */ void ModSet::getMods(const BSONObj &from) { BSONObjIterator it(from); - while ( it.more() ) { + while ( it.moreWithEOO() ) { BSONElement e = it.next(); if ( e.eoo() ) break; @@ -506,7 +506,7 @@ namespace mongo { Mod::Op op = opFromStr( fn ); if ( op == Mod::INC ) strcpy((char *) fn, "$set"); // rewrite for op log - while ( jt.more() ) { + while ( jt.moreWithEOO() ) { BSONElement f = jt.next(); if ( f.eoo() ) break; @@ -535,7 +535,7 @@ namespace mongo { void checkNoMods( BSONObj o ) { BSONObjIterator i( o ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; diff --git a/db/queryoptimizer.cpp b/db/queryoptimizer.cpp index a04a3d749a9..67201323c66 100644 --- a/db/queryoptimizer.cpp +++ b/db/queryoptimizer.cpp @@ -53,15 +53,15 @@ namespace mongo { BSONObj idxKey = index->keyPattern(); BSONObjIterator o( order ); BSONObjIterator k( idxKey ); - if ( !o.more() ) + if ( !o.moreWithEOO() ) scanAndOrderRequired_ = false; - while( o.more() ) { + while( o.moreWithEOO() ) { BSONElement oe = o.next(); if ( oe.eoo() ) { scanAndOrderRequired_ = false; break; } - if ( !k.more() ) + if ( !k.moreWithEOO() ) break; BSONElement ke; while( 1 ) { @@ -90,7 +90,7 @@ namespace mongo { order.getFieldNames( orderFieldsUnindexed ); BSONObjBuilder startKeyBuilder; BSONObjBuilder endKeyBuilder; - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -438,7 +438,7 @@ namespace mongo { BSONObj extremeKeyForIndex( const BSONObj &idxPattern, int baseDirection ) { BSONObjIterator i( idxPattern ); BSONObjBuilder b; - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; diff --git a/db/queryutil.cpp b/db/queryutil.cpp index d4b6219a965..8ebfb06cad1 100644 --- a/db/queryutil.cpp +++ b/db/queryutil.cpp @@ -58,7 +58,7 @@ namespace mongo { case BSONObj::opALL: { massert( "$all requires array", e.type() == Array ); BSONObjIterator i( e.embeddedObject() ); - if ( i.more() ) { + if ( i.moreWithEOO() ) { BSONElement f = i.next(); if ( !f.eoo() ) lower_ = upper_ = f; @@ -70,7 +70,7 @@ namespace mongo { BSONElement max = minKey.firstElement(); BSONElement min = maxKey.firstElement(); BSONObjIterator i( e.embeddedObject() ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement f = i.next(); if ( f.eoo() ) break; @@ -124,7 +124,7 @@ namespace mongo { ns_( ns ), query_( query.getOwned() ) { BSONObjIterator i( query_ ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -135,7 +135,7 @@ namespace mongo { } else { BSONObjIterator i( e.embeddedObject() ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement f = i.next(); if ( f.eoo() ) break; @@ -163,7 +163,7 @@ namespace mongo { } BSONObjBuilder b; BSONObjIterator i( fields ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; diff --git a/db/queryutil.h b/db/queryutil.h index 5c509da8397..298e1bbeec6 100644 --- a/db/queryutil.h +++ b/db/queryutil.h @@ -106,7 +106,7 @@ namespace mongo { int direction = ( spec.firstElement().number() >= 0 ) ? 1 : -1; BSONObjIterator i( spec ); BSONObjBuilder b; - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; diff --git a/db/repl.cpp b/db/repl.cpp index eef27f69eda..1eddb6f6d7b 100644 --- a/db/repl.cpp +++ b/db/repl.cpp @@ -364,7 +364,7 @@ namespace mongo { ret = conn->findOne( "admin.$cmd", forwardCommand.done() ); } BSONObjIterator i( ret ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -715,7 +715,7 @@ namespace mongo { massert( "Unable to get database list", ok ); } BSONObjIterator i( info.getField( "databases" ).embeddedObject() ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; @@ -1064,7 +1064,7 @@ namespace mongo { bool ok = conn->runCommand( "admin", BSON( "listDatabases" << 1 ), info ); massert( "Unable to get database list", ok ); BSONObjIterator i( info.getField( "databases" ).embeddedObject() ); - while( i.more() ) { + while( i.moreWithEOO() ) { BSONElement e = i.next(); if ( e.eoo() ) break; diff --git a/dbtests/jsobjtests.cpp b/dbtests/jsobjtests.cpp index 0e37ce2cd06..398c1e3f7f7 100644 --- a/dbtests/jsobjtests.cpp +++ b/dbtests/jsobjtests.cpp @@ -155,10 +155,14 @@ namespace JsobjTests { ASSERT( o.valid() ); ASSERT_EQUALS( Timestamp, o.getField( "a" ).type() ); BSONObjIterator i( o ); - ASSERT( i.more() ); + ASSERT( i.moreWithEOO() ); + ASSERT( i._more() ); + BSONElement e = i.next(); ASSERT_EQUALS( Timestamp, e.type() ); - ASSERT( i.more() ); + ASSERT( i.moreWithEOO() ); + ASSERT( ! i._more() ); + e = i.next(); ASSERT( e.eoo() ); diff --git a/s/config.cpp b/s/config.cpp index a1518fdb901..b4e53d1dfce 100644 --- a/s/config.cpp +++ b/s/config.cpp @@ -108,11 +108,9 @@ namespace mongo { BSONObj sharded = from.getObjectField( "sharded" ); if ( ! sharded.isEmpty() ){ BSONObjIterator i(sharded); - while ( i.more() ){ + while ( i._more() ){ BSONElement e = i.next(); - if ( e.eoo() ) - break; - uassert( "shared things have to be objects" , e.type() == Object ); + uassert( "sharded things have to be objects" , e.type() == Object ); _sharded[e.fieldName()] = e.embeddedObject(); } } diff --git a/s/cursors.cpp b/s/cursors.cpp index 39254c7e836..e4abae8677a 100644 --- a/s/cursors.cpp +++ b/s/cursors.cpp @@ -65,10 +65,8 @@ namespace mongo { BSONObjBuilder b; BSONObjIterator i( query ); - while ( i.more() ){ + while ( i._more() ){ BSONElement e = i.next(); - if ( e.eoo() ) - break; if ( strcmp( e.fieldName() , "query" ) ){ b.append( e ); diff --git a/s/shard.cpp b/s/shard.cpp index ba347c7c701..95e3ac5cb8a 100644 --- a/s/shard.cpp +++ b/s/shard.cpp @@ -66,10 +66,8 @@ namespace mongo { BSONObjBuilder r; BSONObjIterator i(k); - while( i.more() ) { + while( i._more() ) { BSONElement e = i.next(); - if ( e.eoo() ) - break; uassert( "can only handle numbers here - which i think is correct" , e.isNumber() ); r.append( e.fieldName() , -1 * e.number() ); } diff --git a/s/shardkey.cpp b/s/shardkey.cpp index 1085c30f695..c7be584f77b 100644 --- a/s/shardkey.cpp +++ b/s/shardkey.cpp @@ -432,7 +432,7 @@ normal: BSONElement e = s.next(); if( e.eoo() ) break; - if( !p.more() ) + if( !p.moreWithEOO() ) return 0; BSONElement ep = p.next(); bool same = e == ep; diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp index 665e829e293..98c8a5e4fc7 100644 --- a/scripting/engine_spidermonkey.cpp +++ b/scripting/engine_spidermonkey.cpp @@ -42,10 +42,8 @@ namespace mongo { BSONFieldIterator( BSONHolder * holder ){ BSONObjIterator it( holder->_obj ); - while ( it.more() ){ + while ( it._more() ){ BSONElement e = it.next(); - if ( e.eoo() ) - break; _names.push_back( e.fieldName() ); } @@ -813,11 +811,8 @@ namespace mongo { return; BSONObjIterator i( *data ); - while ( i.more() ){ + while ( i._more() ){ BSONElement e = i.next(); - if ( e.eoo() ) - break; - _convertor->setProperty( _global , e.fieldName() , _convertor->toval( e ) ); } |