@@ -852,17 +852,10 @@ def iterview(self, name, batch, wrapper=None, **options):
852
852
limit = options .get ('limit' )
853
853
if limit is not None and limit <= 0 :
854
854
raise ValueError ('limit must be 1 or more' )
855
- startkey , startkey_docid = (options .get ('startkey' ),
856
- options .get ('startkey_docid' ))
857
855
while True :
858
856
loop_limit = min (limit or batch , batch )
859
857
# Get rows in batches, with one extra for start of next batch.
860
858
options ['limit' ] = loop_limit + 1
861
- # Add start keys, if any.
862
- if startkey is not None : # XXX todo: None is a valid key value
863
- options ['startkey' ] = startkey
864
- if startkey_docid is not None :
865
- options ['startkey_docid' ] = startkey_docid
866
859
rows = list (self .view (name , wrapper , ** options ))
867
860
# Yield rows from this batch.
868
861
for row in itertools .islice (rows , loop_limit ):
@@ -873,8 +866,8 @@ def iterview(self, name, batch, wrapper=None, **options):
873
866
# Check if there is nothing else to yield.
874
867
if len (rows ) <= batch or (limit is not None and limit == 0 ):
875
868
break
876
- # Save start keys for next loop.
877
- startkey , startkey_docid = rows [- 1 ]['key' ], rows [- 1 ]['id' ]
869
+ # Update options with start keys for next loop.
870
+ options . update ( startkey = rows [- 1 ]['key' ], startkey_docid = rows [- 1 ]['id' ])
878
871
879
872
def show (self , name , docid = None , ** options ):
880
873
"""Call a 'show' function.
0 commit comments