Sam Stone
04/13/2022, 12:01 AMList.zip(List).toMap(mutableMapOf())
?nkiesel
04/13/2022, 12:53 AMList.zip(List).toMap().toMutableMap()
but that is mostly personal preferencenkiesel
04/13/2022, 12:54 AMgildor
04/13/2022, 3:02 AMgildor
04/13/2022, 3:03 AMgildor
04/13/2022, 3:13 AMSam Stone
04/14/2022, 10:48 PMSam Stone
04/14/2022, 10:50 PMzipTo
?gildor
04/16/2022, 2:08 AMgildor
04/16/2022, 2:12 AMgildor
04/16/2022, 2:12 AMgildor
04/16/2022, 2:13 AMnkiesel
04/16/2022, 2:15 AMgildor
04/16/2022, 2:18 AMgildor
04/16/2022, 2:19 AMhappy enough with zip+toMapTo be honest it’s not super efficient way, if you use it often, I would just write own function as one which I posted, just without destination
nkiesel
04/16/2022, 2:22 AMList.zip(List).toMap(mutableMapOf())
not good enough? And yes: if that method would become a hotspot, I would try to optimize it along your code.gildor
04/16/2022, 11:20 AMgildor
04/16/2022, 11:21 AMif that method would become a hotspotNot only because it’s hotspot, just a bit less GC pressure and clearly shows intent of the code