Eugen Martynov
04/20/2025, 12:26 PMCLOVIS
04/22/2025, 8:17 AMEugen Martynov
04/22/2025, 2:38 PMCLOVIS
04/22/2025, 2:41 PMDan Rusu
04/22/2025, 3:53 PMKlitos Kyriacou
04/22/2025, 5:22 PMbinarySearch
on arrays.Klitos Kyriacou
04/22/2025, 5:28 PMArray<whatever>.asList()
which wraps the original array and doesn't create boxed versions of each element, so you get to keep the memory efficiency, cache locality etc.Dan Rusu
04/22/2025, 5:59 PMasList()
on a primitive array auto-boxes the values each time they are accessed because all the list operations operate on generics. So the asList()
operation itself doesn't auto-box anything but all subsequent operations will.Eugen Martynov
04/23/2025, 5:37 AMKlitos Kyriacou
04/23/2025, 12:05 PMtoList()
instead of asList()
.