can I safely increase an array in this way, withou...
# announcements
e
can I safely increase an array in this way, without an intermediary temporary variable?
Copy code
ptrId = Array(newBufLength) { i -> ptrId.getOrElse(i) { i } }
d
Safely? It shouldn't throw if that's what you're asking. There are dedicated functions for this iirc.
copyOf
.
e
I mean, can I assign directly to
ptrId
by reading it in the init fun?
d
Oh. Yes, the right side is evaluated before the assignment.