frellan
10/16/2018, 2:08 PM.filter only if a certain condition is true, how do I do that? .apply { if (boolean) filter {} } does not seem to workgildor
10/16/2018, 2:36 PMelse thisgildor
10/16/2018, 2:37 PMapply with rungildor
10/16/2018, 2:37 PMSam
10/16/2018, 3:33 PMSam
10/16/2018, 3:33 PMinline fun <T> Iterable<T>.filterIf( applyFilter : Boolean, predicate: (T) -> Boolean ) : List<T> =
        if( applyFilter ) filter( predicate ) else toList()Sam
10/16/2018, 3:34 PMSam
10/16/2018, 3:35 PM