File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -557,17 +557,11 @@ function _onNext(error, doc) {
557557
558558 if ( this . ctx . _batchDocs . length < this . ctx . options . _populateBatchSize ) {
559559 // If both `batchSize` and `_populateBatchSize` are huge, calling `next()` repeatedly may
560- // cause a stack overflow. So make sure we clear the stack regularly.
561- if ( this . ctx . _batchDocs . length > 0 && this . ctx . _batchDocs . length % 1000 === 0 ) {
562- return immediate ( ( ) => this . ctx . cursor . next ( ) . then (
563- res => { _onNext . call ( this , null , res ) ; } ,
564- err => { _onNext . call ( this , err ) ; }
565- ) ) ;
566- }
567- this . ctx . cursor . next ( ) . then (
560+ // cause a stack overflow. So make sure we clear the stack.
561+ immediate ( ( ) => this . ctx . cursor . next ( ) . then (
568562 res => { _onNext . call ( this , null , res ) ; } ,
569563 err => { _onNext . call ( this , err ) ; }
570- ) ;
564+ ) ) ;
571565 } else {
572566 _populateBatch . call ( this ) ;
573567 }
You can’t perform that action at this time.
0 commit comments