In Scala, how to use Ordering[T] with List.min or List.max and keep code readable

前端 未结 6 560
轮回少年
轮回少年 2020-12-23 20:58

In Scala 2.8, I had a need to call List.min and provide my own compare function to get the value based on the second element of a Tuple2. I had to write this kind of code:

6条回答
提交回复
热议问题