diff options
author | Wouter Bolsterlee <uws@xs4all.nl> | 2014-11-29 20:37:41 +0100 |
---|---|---|
committer | Wouter Bolsterlee <uws@xs4all.nl> | 2014-11-29 20:37:41 +0100 |
commit | 6205177b348d899d29eca6760566db51c300ed20 (patch) | |
tree | 3acd1efeeb43287eb92402fbfff140e68181c420 /happybase | |
parent | ad2673e38f0a140bfdfbc7580ea9360decf689d5 (diff) | |
download | happybase-6205177b348d899d29eca6760566db51c300ed20.tar.gz |
Avoid useless round-trip when using scan(limit=...)
See #73.
Diffstat (limited to 'happybase')
-rw-r--r-- | happybase/table.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/happybase/table.py b/happybase/table.py index 1477809..3cb26b7 100644 --- a/happybase/table.py +++ b/happybase/table.py @@ -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( |