Skip to content

Commit

Permalink
Review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
borichellow committed Dec 17, 2024
1 parent c8149dc commit 6ceb9b2
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,8 @@ class AudioWavesMaskHelper @Inject constructor(
}

private fun List<Int>.averageInt(): Double {
var sum = 0.0
var count = 0
for (element in this) {
sum += element
++count
}
return if (count == 0) 0.0 else sum / count
if (isEmpty()) return 0.0
return sum().toDouble() / size
}

fun clear() {
Expand Down

0 comments on commit 6ceb9b2

Please sign in to comment.