pages.toMutableMap().apply { this[currentPage] = it }.toMap())
n
nanodeath
08/20/2020, 10:09 PM
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