maybe ``` val frameDurationArray = IntArray(frames...
# announcements
m
maybe
Copy code
val frameDurationArray = IntArray(frames + 1) { animation?.getDuration(it)!! }
val duration = frameDurationArray.sum()
n
Interesting, I can easily use
reduce
by creating an Array like you do… Thanks!
d
strange, I can call reduce on a range, as ranges are Iterable and reduce is defined for Iterable
n
@drako You are right. I missed the last one here: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/reduce.html Still, I am not sure why
reduce
did not appear in AS auto-complete. Perhaps I did not put my range inside parentheses.