summaryrefslogtreecommitdiff
path: root/db/index_geo2d.cpp
diff options
context:
space:
mode:
authorDwight Merriman <dwight@10gen.com>2010-04-20 19:42:53 -0400
committerDwight Merriman <dwight@10gen.com>2010-04-20 19:42:53 -0400
commit18f361418835e8379c5a80869e35dfb61347c233 (patch)
tree230ecaa5f0aed90645536a139ae1193c82257373 /db/index_geo2d.cpp
parent2bef8e784f6b2f9ba9799c5f931be5353208fece (diff)
downloadmongo-18f361418835e8379c5a80869e35dfb61347c233.tar.gz
faster! Ordering class
Diffstat (limited to 'db/index_geo2d.cpp')
-rw-r--r--db/index_geo2d.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/db/index_geo2d.cpp b/db/index_geo2d.cpp
index 0d62aa22c4f..9a546d9dc24 100644
--- a/db/index_geo2d.cpp
+++ b/db/index_geo2d.cpp
@@ -981,16 +981,19 @@ namespace mongo {
static bool initial( const IndexDetails& id , const Geo2dType * spec ,
BtreeLocation& min , BtreeLocation& max ,
GeoHash start ,
- int & found , GeoAccumulator * hopper ){
+ int & found , GeoAccumulator * hopper )
+ {
+ Ordering ordering = Ordering::make(spec->_order);
+
min.bucket = id.head.btree()->locate( id , id.head , start.wrap() ,
- spec->_order , min.pos , min.found , minDiskLoc );
+ ordering , min.pos , min.found , minDiskLoc );
min.checkCur( found , hopper );
max = min;
if ( min.bucket.isNull() ){
min.bucket = id.head.btree()->locate( id , id.head , start.wrap() ,
- spec->_order , min.pos , min.found , minDiskLoc , -1 );
+ ordering , min.pos , min.found , minDiskLoc , -1 );
min.checkCur( found , hopper );
}
@@ -1094,7 +1097,7 @@ namespace mongo {
}
BtreeLocation loc;
- loc.bucket = id.head.btree()->locate( id , id.head , toscan.wrap() , _spec->_order ,
+ loc.bucket = id.head.btree()->locate( id , id.head , toscan.wrap() , Ordering::make(_spec->_order) ,
loc.pos , loc.found , minDiskLoc );
loc.checkCur( _found , _hopper.get() );
while ( loc.hasPrefix( toscan ) && loc.advance( 1 , _found , _hopper.get() ) )