Skip to content

Commit

Permalink
fix: Remove local variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 29, 2021
1 parent 15bf8de commit 58a3919
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/Operation/Flatten.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,9 @@ static function (Iterator $iterator) use ($depth): Generator {
continue;
}

if (1 !== $depth) {
/** @var callable(Iterator<TKey, T>): Generator<mixed, mixed> $flatten */
$flatten = Flatten::of()($depth - 1);

$value = $flatten(new IterableIterator($value));
}

yield from $value;
yield from (1 !== $depth)
? (new Flatten())()($depth - 1)(new IterableIterator($value))
: $value;
}
};
}
Expand Down

0 comments on commit 58a3919

Please sign in to comment.