Skip to content
Snippets Groups Projects
Commit eefde236 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fix

parent f94f475e
No related branches found
No related tags found
No related merge requests found
......@@ -211,9 +211,7 @@ cdef class Chunk:
yield self.get_piece_at(i)
def __iter__(self) -> tp.Iterator[tp.Tuple[int, bytes]]:
cdef int i
for i in range(self.entries):
yield self.get_piece_at(i)
return self._iterate(0, self.entries)
def __len__(self):
return self.length()
......
......@@ -31,11 +31,11 @@ cdef class Iterator:
cpdef void close(self):
"""
Close this iterator, release chunks.
It is imperative that you call this, otherwise some chunks might remain in memory.
This is hooked by destructor, but release it manually ASAP.
No-op if iterator is already closed.
"""
if self.closed:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment