Skip to content

Commit 7c24ed7

Browse files
committed
refactor(support): simplify ternary with min/max call
1 parent 9b988f4 commit 7c24ed7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/support/src/Math/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ function max(array $numbers): null|int|float
380380
*/
381381
function maxva(int|float $first, int|float $second, int|float ...$rest): int|float
382382
{
383-
$max = $first > $second ? $first : $second;
383+
$max = \max($first, $second);
384384

385385
foreach ($rest as $number) {
386386
if ($number > $max) {
@@ -512,7 +512,7 @@ function min(array $numbers): null|float|int
512512
*/
513513
function minva(int|float $first, int|float $second, int|float ...$rest): int|float
514514
{
515-
$min = $first < $second ? $first : $second;
515+
$min = \min($first, $second);
516516

517517
foreach ($rest as $number) {
518518
if ($number < $min) {

0 commit comments

Comments
 (0)