We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac22428 commit 79a8b3eCopy full SHA for 79a8b3e
src/main/com/mongodb/DBCursor.java
@@ -602,12 +602,8 @@ public void remove(){
602
603
void _fill( int n ){
604
_checkType( CursorType.ARRAY );
605
- try {
606
- while ( n >= _all.size() && _hasNext() )
607
- _next();
608
- } finally {
609
- this.close();
610
- }
+ while ( n >= _all.size() && _hasNext() )
+ _next();
611
}
612
613
/**
@@ -653,16 +649,12 @@ public List<DBObject> toArray( int max ) {
653
649
* @throws MongoException
654
650
*/
655
651
public int itcount(){
656
657
- int n = 0;
658
- while ( this.hasNext() ){
659
- this.next();
660
- n++;
661
662
- return n;
663
664
652
+ int n = 0;
+ while ( this.hasNext() ){
+ this.next();
+ n++;
665
+ return n;
666
667
668
0 commit comments