Jason5lee
03/25/2022, 8:21 AMkotlinx.collections.immutable
.
4. Others. State in the comment.Michael de Kaste
03/25/2022, 9:02 AMKlitos Kyriacou
03/25/2022, 9:22 AMMichael de Kaste
03/25/2022, 11:09 AMJoffrey
03/25/2022, 12:20 PMtoList
could break if someone modifies the underlying list while you're creating the copy. The drawback of making a full copy, depending on the size, is also a downer.
99% of the time, I don't think you need anything more than List
or Map
interfaces, especially if callers are in your own code base. It would be very weird for someone to concurrently modify a list when calling a function on that list, so I don't expect that to be a real problem in practiceSemir Rahic
03/28/2022, 6:01 AMJoffrey
03/28/2022, 6:13 AM