Skip to content

Commit

Permalink
Avoid useless round-trip when using scan(limit=...)
Browse files Browse the repository at this point in the history
See #73.
  • Loading branch information
wbolster committed Nov 29, 2014
1 parent ad2673e commit 6205177
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions happybase/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def scan(self, row_start=None, row_stop=None, row_prefix=None,
scan_id, how_many)

if not items:
break # scan has finished
return # scan has finished

n_fetched += len(items)

Expand All @@ -401,7 +401,7 @@ def scan(self, row_start=None, row_stop=None, row_prefix=None,
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(
Expand Down

0 comments on commit 6205177

Please sign in to comment.