Skip to content

Commit

Permalink
fix: prevent wrapping and unwrapping arrays when it's not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 17, 2022
1 parent 3571e0c commit 08af31b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public function foldRight1(callable $callback): mixed

public function forget(mixed ...$keys): CollectionInterface
{
return new self((new Operation\Forget())()(...$keys), [$this]);
return new self((new Operation\Forget())()($keys), [$this]);
}

public function frequency(): CollectionInterface
Expand Down
6 changes: 3 additions & 3 deletions src/Operation/Forget.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
final class Forget extends AbstractOperation
{
/**
* @return Closure(TKey...): Closure(iterable<TKey, T>): Generator<TKey, T>
* @return Closure(array<TKey>): Closure(iterable<TKey, T>): Generator<TKey, T>
*/
public function __invoke(): Closure
{
return
/**
* @param TKey ...$keys
* @param array<TKey> $keys
*
* @return Closure(iterable<TKey, T>): Generator<TKey, T>
*/
static fn (mixed ...$keys): Closure => (new Filter())()(
static fn (array $keys): Closure => (new Filter())()(
/**
* @param T $value
* @param TKey $key
Expand Down

0 comments on commit 08af31b

Please sign in to comment.