summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-03-16 11:14:28 -0400
committerEliot Horowitz <eliot@10gen.com>2011-03-16 11:27:52 -0400
commitcc5b8c1094dccb231c9645d63f1664b721cc9366 (patch)
tree56ef25fe49c9e13220b6edd834ed1bf8d6573bcf
parent2ad98fd1fa41b51f89e14c3c3b655f788564b09a (diff)
downloadmongo-cc5b8c1094dccb231c9645d63f1664b721cc9366.tar.gz
use nextSafe 180
-rw-r--r--s/balance.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/s/balance.cpp b/s/balance.cpp
index 05703800a3a..ee0c99262c1 100644
--- a/s/balance.cpp
+++ b/s/balance.cpp
@@ -147,7 +147,7 @@ namespace mongo {
auto_ptr<DBClientCursor> cursor = conn.query( ShardNS::collection , BSONObj() );
vector< string > collections;
while ( cursor->more() ) {
- BSONObj col = cursor->next();
+ BSONObj col = cursor->nextSafe();
// sharded collections will have a shard "key".
if ( ! col["key"].eoo() )
@@ -199,7 +199,7 @@ namespace mongo {
map< string,vector<BSONObj> > shardToChunksMap;
cursor = conn.query( ShardNS::chunk , QUERY( "ns" << ns ).sort( "min" ) );
while ( cursor->more() ) {
- BSONObj chunk = cursor->next();
+ BSONObj chunk = cursor->nextSafe();
vector<BSONObj>& chunks = shardToChunksMap[chunk["shard"].String()];
chunks.push_back( chunk.getOwned() );
}