1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-27 22:38:30 +09:00

Remove unused code

This commit is contained in:
Aya Morisawa 2018-12-27 20:10:29 +09:00
parent ba05606074
commit 0f204eebe1
No known key found for this signature in database
GPG Key ID: 3E64865D70D579F2

View File

@ -1,11 +0,0 @@
/**
*
* @param samples
*/
export default function(samples) {
if (!samples.length) return 0;
const numbers = samples.slice(0).sort((a, b) => a - b);
const middle = Math.floor(numbers.length / 2);
const isEven = numbers.length % 2 === 0;
return isEven ? (numbers[middle] + numbers[middle - 1]) / 2 : numbers[middle];
}