is this the best we can do ? ```pages.toMutableMap...
# getting-started
u
is this the best we can do ?
Copy code
pages.toMutableMap().apply { this[currentPage] = it }.toMap())
n
don't think so -- that duplicates the entire map twice, when you really only need to duplicate it once. 1. convert to mutable map, 2. add field, 3. return (or cast I guess) to Map
i
Just put a key-value pair to it:
pages + (currentPage to it)
🙌 1
n
oh yeah 😛