spand
12/06/2018, 12:49 PMreduce
that works for empty collections by returning null
?
I can see that there are specializations of it (.minBy
, .minWith
, ..) but a general version escapes me.elizarov
12/06/2018, 1:00 PMc.takeIf { it.isNotEmpty() }?.reduce { ... }
miha-x64
12/06/2018, 1:18 PMfold