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
This commit is contained in:
parent
a8e161ba70
commit
5dac34716b
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue