summaryrefslogtreecommitdiff
path: root/db/extsort.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-09-24 11:57:45 -0400
committerEliot Horowitz <eliot@10gen.com>2009-09-24 11:57:45 -0400
commit6d258c54de57565f632dcf086d93ef10a3ccaba8 (patch)
treecfee12360d2da90ed0ccdd4941a8d6dee054aab9 /db/extsort.cpp
parent46000ef2d456b6cf9d6099e6bb2e0f26fbd1e690 (diff)
downloadmongo-6d258c54de57565f632dcf086d93ef10a3ccaba8.tar.gz
sort by obj,diskloc SERVER-291
Diffstat (limited to 'db/extsort.cpp')
-rw-r--r--db/extsort.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/db/extsort.cpp b/db/extsort.cpp
index 81544d173d5..781a87a9bb5 100644
--- a/db/extsort.cpp
+++ b/db/extsort.cpp
@@ -74,7 +74,7 @@ namespace mongo {
uassert( "sorted already" , ! _sorted );
if ( ! _map ){
- _map = new multimap<BSONObj,DiskLoc,BSONObjCmp>( _order );
+ _map = new InMemory( _order );
}
_map->insert( pair<BSONObj,DiskLoc>( o , loc ) );
@@ -105,8 +105,8 @@ namespace mongo {
uassert( (string)"couldn't open file: " + file , out.good() );
int num = 0;
- for ( multimap<BSONObj,DiskLoc,BSONObjCmp>::iterator i=_map->begin(); i != _map->end(); i++ ){
- pair<BSONObj,DiskLoc> p = *i;
+ for ( InMemory::iterator i=_map->begin(); i != _map->end(); i++ ){
+ Data p = *i;
out.write( p.first.objdata() , p.first.objsize() );
out.write( (char*)(&p.second) , sizeof( DiskLoc ) );
num++;
@@ -158,7 +158,7 @@ namespace mongo {
continue;
}
- if ( slot == -1 || _cmp( best.first , _stash[i].first.first ) == 0 ){
+ if ( slot == -1 || _cmp( best , _stash[i].first ) == 0 ){
best = _stash[i].first;
slot = i;
}