mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-24 18:13:00 +01:00
ChunkedIterator for Traversable - Fixed
This commit is contained in:
parent
875452a58b
commit
1f55162736
@ -25,16 +25,16 @@ class ChunkedIterator extends \IteratorIterator
|
||||
|
||||
public function rewind()
|
||||
{
|
||||
parent::rewind();
|
||||
$this->next();
|
||||
}
|
||||
|
||||
public function next()
|
||||
{
|
||||
$this->chunk = array();
|
||||
$inner = $this->getInnerIterator();
|
||||
for ($i = 0; $i < $this->chunkSize && $inner->valid(); $i++) {
|
||||
$this->chunk[] = $inner->current();
|
||||
$inner->next();
|
||||
for ($i = 0; $i < $this->chunkSize && parent::valid(); $i++) {
|
||||
$this->chunk[] = parent::current();
|
||||
parent::next();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user