Skip to content

Commit

Permalink
fix ACounter
Browse files Browse the repository at this point in the history
  • Loading branch information
Corvette653 committed Jan 24, 2024
1 parent 8c3e860 commit f9b6aa3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/kotlin/metrics/counter/ACounter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class MutableACounter<T : Number>(private val range: Int) : ACounter<T>,
truncated.lastOrNull()?.let { (d, v) ->
when (day) {
d -> truncated.dropLast(1) + (d to v + value)
d + 1 -> truncated + (day to value)
else -> truncated
else -> truncated + (day to value)
}
} ?: listOf(day to value)
}
Expand Down

0 comments on commit f9b6aa3

Please sign in to comment.