Avoid useless round-trip when using scan(limit=...)

See #73.
This commit is contained in:
Wouter Bolsterlee 2014-11-29 20:37:41 +01:00
parent ad2673e38f
commit 6205177b34
1 changed files with 2 additions and 2 deletions

View File

@ -387,7 +387,7 @@ class Table(object):
scan_id, how_many)
if not items:
break # scan has finished
return # scan has finished
n_fetched += len(items)
@ -401,7 +401,7 @@ class Table(object):
yield item.row, row
if limit is not None and n_returned == limit:
break # not interested in the remainder
return # scan has finished
finally:
self.connection.client.scannerClose(scan_id)
logger.debug(