mirror of https://github.com/hykilpikonna/AquaDX
[F] Fix index out of bounds
parent
f3090870be
commit
ff9358b986
|
@ -25,6 +25,7 @@ fun findTrend(log: List<TrendLog>): List<TrendOut> {
|
|||
|
||||
// O(n log n)
|
||||
val d = log.sortedBy { it.date }.toList()
|
||||
if (d.isEmpty()) return listOf()
|
||||
|
||||
// Precompute the play counts for each date in O(n)
|
||||
val playCounts = d.groupingBy { it.date }.eachCount()
|
||||
|
|
Loading…
Reference in New Issue