Skip to content
Permalink
Browse files

Simpler return for median method

  • Loading branch information...
Iandenh committed Jul 27, 2017
1 parent 593bece commit beda674cd16f6e783132b1806dd573277893fa41
Showing with 1 addition and 3 deletions.
  1. +1 −3 src/Collection/CollectionTrait.php
@@ -236,9 +236,7 @@ public function median($matcher = null)
return $values[$middle];
}
return (new static([
$values[$middle - 1], $values[$middle],
]))->avg();
return ($values[$middle - 1] + $values[$middle]) / 2;
}
/**

0 comments on commit beda674

Please sign in to comment.
You can’t perform that action at this time.