diff options
author | Samuel Merritt <sam@swiftstack.com> | 2014-10-13 16:40:50 -0700 |
---|---|---|
committer | Samuel Merritt <sam@swiftstack.com> | 2014-10-13 16:43:01 -0700 |
commit | 5dac34716bfcd1af2780c90f76d8f9aac93bf9c1 (patch) | |
tree | 30030d4b3aa4b2be6406feb67fbd057d8096405d | |
parent | a8e161ba7056cd23c1823de1c048e8ee0b16617d (diff) | |
download | swift-bench-5dac34716bfcd1af2780c90f76d8f9aac93bf9c1.tar.gz |
Fix next on SourceFile
next(iterable) is supposed to return the next thing in the sequence;
here, that's a bunch of zeros. However, this was returning a generator
that yielded one item: a bunch of zeros. This broke direct
benchmarking.
Change-Id: I2fca4795fc9b3d1637c72616a52a60482d6e853e
-rw-r--r-- | swiftbench/bench.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/swiftbench/bench.py b/swiftbench/bench.py index 44ffa88..bc899ea 100644 --- a/swiftbench/bench.py +++ b/swiftbench/bench.py @@ -101,8 +101,8 @@ class SourceFile(object): if self.pos >= self.size: raise StopIteration chunk_size = min(self.size - self.pos, self.chunk_size) - yield '0' * chunk_size self.pos += chunk_size + return '0' * chunk_size def read(self, desired_size): chunk_size = min(self.size - self.pos, desired_size) |