Derek Peirce
11/04/2026, 8:54 PMlistOf(…).forEach { … } into arrayOf(…) { … } (or appropriate primitive array)? arrayOf is typically discouraged within Kotlin because it has some wonky behaviors, but in specific cases like this, which I’ve found to be a fairly common pattern, it would have identical functionality, while eliminating two object allocations (outer list, iterator) and simplifying the looping logic.Youssef Shoaib [MOD]
11/04/2026, 9:00 PMjw
11/04/2026, 9:17 PMjw
11/04/2026, 9:18 PMlistOf inlined into the call site, the iteration semantics of ArrayList are defined in the platform and not in code that R8 can see. So for all it knows the elements are produced backwards in certain conditions.Derek Peirce
11/04/2026, 9:23 PM