Join Slack
Powered by
If I have a bunch of operations on a Sequence<L...
# announcements
j
Jonathan Walsh
07/19/2018, 12:38 AM
If I have a bunch of operations on a Sequence<Long>, is each step unboxing and boxing the value? Or is a primitive long being passed through each step? For example
Copy code
sequenceOf(1L, 2L, 3L).map { it + 1L }.forEach { println(it) }
k
karelpeeters
07/19/2018, 7:36 AM
Yes, at every step everything is boxed and unboxed. That's always the case when using primitives in generics.
2
Views
Open in Slack
Previous
Next