From d6d8aa68bc2965d3cb52d863cacfc9a767c56bba Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 30 Jan 2022 21:31:55 +0100 Subject: [PATCH] refactor: Remove useless intermediary variable. --- src/Operation/RSample.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Operation/RSample.php b/src/Operation/RSample.php index 464a08f02..0f6c17f82 100644 --- a/src/Operation/RSample.php +++ b/src/Operation/RSample.php @@ -35,9 +35,9 @@ public function __invoke(): Closure * @return Closure(Iterator): Generator */ 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;