Syed Faraz
07/19/2019, 9:10 AMmapto
plus takeif
in chain, so that only those which satisfy operation are mapped to an arraylist?wasyl
07/19/2019, 9:20 AMcollection.filter { }.mapTo(arrayList()) { }
tseisel
07/19/2019, 9:28 AMcollection.mapNotNullTo(arrayListOf()) { item ->
item.transform().takeIf { it.satisfiesPredicate() }
}
gildor
07/19/2019, 9:29 AM