elect
06/30/2023, 8:19 AMIntArray
with a given comparator? I see only sortedWith
, which returns a new sorted listDerek Peirce
06/30/2023, 8:27 AMMichael de Kaste
06/30/2023, 8:30 AMval array = Array(10) { it }
Arrays.sort(array, reverseOrder())
Sam
06/30/2023, 8:31 AMIntArray
deals in primitives and Comparators deal in objects, which means there would be a lot of boxing involved if such a method existedKlitos Kyriacou
06/30/2023, 9:35 AMelect
07/01/2023, 6:58 AMDerek Peirce
07/02/2023, 1:57 AMComparator
were replaced with a traditional lambda, but I think the sheer amount of code that would have to be inlined for an optimized sorting method would make that a poor candidate for inlining.