louiscad
01/17/2019, 9:12 AMcountIndexed
and sumByIndexed
to the stdlib. In an effort to remove a var
and a forEachIndexed
, I came across this need. However, I'd not want to bloat the stdlib. Please, add your ➕ if already needed one of these functions.Pavlo Liapota
01/17/2019, 9:31 AMfoldIndexed
instead of var
and forEachIndexed
.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/fold-indexed.htmlPavlo Liapota
01/17/2019, 9:42 AMlouiscad
01/17/2019, 9:52 AMmarcinmoskala
01/17/2019, 10:05 PMwithIndex
and destructuring.marcinmoskala
01/17/2019, 10:05 PMlist.withIndex().sumBy { (index, value) -> ... }
louiscad
01/18/2019, 7:30 AMmarcinmoskala
01/18/2019, 5:37 PM