Skip to content

Commit

Permalink
don't advance iterator if empty/at end for geo cursor SERVER-3428
Browse files Browse the repository at this point in the history
  • Loading branch information
gregs committed Jul 14, 2011
1 parent 4ef7ea1 commit 146ef71
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion db/geo/2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,14 @@ namespace mongo {
virtual Record* _current() { assert(ok()); return _cur->_loc.rec(); }
virtual BSONObj current() { assert(ok()); return _cur->_o; }
virtual DiskLoc currLoc() { assert(ok()); return _cur->_loc; }
virtual bool advance() { _cur++; incNscanned(); return ok(); }
virtual bool advance() {
bool isOk = ok();
if( isOk ){
_cur++;
incNscanned();
}
return isOk;
}
virtual BSONObj currKey() const { return _cur->_key; }

virtual string toString() {
Expand Down

0 comments on commit 146ef71

Please sign in to comment.