Skip to content

Commit

Permalink
Update Apply.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jan 30, 2021
1 parent 0567c27 commit 2797d5d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Operation/Apply.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ static function (Iterator $iterator) use ($callbacks): Generator {
$continue = true;

foreach ($iterator as $key => $value) {
if (false !== $continue) {
foreach ($callbacks as $callback) {
if (true === $continue = $callback($value, $key)) {
continue;
}
if (true === $continue) {
foreach ($callbacks as $cKey => $callback) {
$result = $callback($value, $key);

$continue = false;
if (false === $result) {
unset($callbacks[$cKey]);
}
}
}

Expand Down

0 comments on commit 2797d5d

Please sign in to comment.