Chore: Simplify midpoint calc.

Co-authored-by: Frank Elsinga <frank@elsinga.de>
pull/4264/head
Nelson Chan 1 month ago committed by GitHub
parent 1c34f30f57
commit 73952b8f7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -508,10 +508,7 @@ export default {
const maxPing = datapoints.reduce((max, current) => Math.max(max, current.maxPing), 0);
// Find the middle timestamp to use
let midpoint = 0;
if (datapoints.length > 1) {
midpoint = Math.floor(datapoints.length / 2);
}
let midpoint = Math.floor(datapoints.length / 2);
return {
timestamp: datapoints[midpoint].timestamp,

Loading…
Cancel
Save