Skip to content

Commit

Permalink
refactor: prevent the creation of an extra variable
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Sep 28, 2022
1 parent 2e50e49 commit 31f87a8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Operation/Apply.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ public function __invoke(): Closure
static function (iterable $iterable) use ($callbacks): Generator {
foreach ($iterable as $key => $value) {
foreach ($callbacks as $cKey => $callback) {
$result = $callback($value, $key, $iterable);

if (false === $result) {
if (false === $callback($value, $key, $iterable)) {
unset($callbacks[$cKey]);
}
}
Expand Down

0 comments on commit 31f87a8

Please sign in to comment.