orangy
kevinmost
06/08/2017, 10:25 PMlistView.forEachIndexed { i, item ->
if (i == listView.lastIndex) return@forEachIndexed
item.addDivider()
}
orangy
orangy
kevinmost
06/08/2017, 10:27 PMorangy
reduce
items.reduce { last, current -> last.addDivider(); current }
kevinmost
06/08/2017, 10:31 PMorangy
witoldsz
06/08/2017, 10:32 PMforEach
, because reduce
is supposed to create something new. It is surprising to see reduce
working for a side effects (while forEach
is meant to do so).witoldsz
06/08/2017, 10:36 PMcedric
06/09/2017, 12:08 AMList.lastIndex
, I think List.isLastIndex(i: Int): Boolean
would make sense too, since very often, that last index is tested for equalityRuckus
06/09/2017, 12:15 AMKruger Brent
06/09/2017, 6:10 AMcrpr
06/09/2017, 10:38 AMdierre
06/09/2017, 12:38 PMdierre
06/09/2017, 12:38 PMdierre
06/09/2017, 12:39 PMjava
source can’t see itdierre
06/09/2017, 12:39 PMdierre
06/09/2017, 12:40 PMdierre
06/09/2017, 12:41 PMs952163
06/09/2017, 12:41 PMdragas
06/09/2017, 1:08 PMmiha-x64
06/09/2017, 1:14 PMconst val
with null
value?tapchicoma
06/09/2017, 1:23 PMtapchicoma
06/09/2017, 1:24 PMconst
is inlinedmiha-x64
06/09/2017, 1:27 PMconst val uglyThing = null
, like typealias
🙂tapchicoma
06/09/2017, 1:35 PMconst
can be only simple types and Stringvaskir
06/09/2017, 1:45 PM