Skip to content

Commit

Permalink
refactor: Remove useless intermediary variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jan 30, 2022
1 parent 9ac298a commit d6d8aa6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Operation/RSample.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public function __invoke(): Closure
* @return Closure(Iterator<TKey, T>): Generator<TKey, T>
*/
static function (float $probability): Closure {
$callback = static fn (): bool => (mt_rand() / mt_getrandmax()) < $probability;

$filter = (new Filter())()($callback);
$filter = (new Filter())()(
static fn (): bool => (mt_rand() / mt_getrandmax()) < $probability
);

// Point free style.
return $filter;
Expand Down

0 comments on commit d6d8aa6

Please sign in to comment.