Skip to content

Commit 82956d3

Browse files
author
decole
committed
Optimize MinBy
1 parent 3e1d6dd commit 82956d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Fp/Operations/MinByElementOperation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public function __invoke(callable $by): Option
2626
* @param TV $l
2727
* @return int
2828
*/
29-
fn(mixed $r, mixed $l): int => $by($l) <=> $by($r);
29+
fn(mixed $r, mixed $l): int => $by($r) <=> $by($l);
3030

3131
$gen = SortedOperation::of($this->gen)($f);
3232

33-
return LastOperation::of($gen)();
33+
return FirstOperation::of($gen)();
3434
}
3535
}

0 commit comments

Comments
 (0)