Guy Bieber10/06/2020, 10:25 PM
gildor10/06/2020, 11:46 PM
a little surprised that mutableMapOf promises to maintain key orderThere is no such promise
but considering the contract ofIt's not a part of contract, it's an implementation detail, but it intentional, to avoid many bugs caused by usage map and expect that it keeps order
jim10/06/2020, 11:49 PM
There is no such promise@gildor Did you read the contract for
? Can you elaborate? Because I'm not sure how else to interpret the docs.
Guy Bieber10/06/2020, 11:56 PM
gildor10/07/2020, 12:27 AM
Chuck Jazdzewski [G]10/07/2020, 3:55 PM
does, whose iteration order is insertion order, but uses a doubly-linked list to maintain this order. The map returned by
is more similar to
which does not guarantee a stable order. It is implemented by using
which also does not guarantee a stable order.
Guy Bieber10/08/2020, 6:15 PM
Chuck Jazdzewski [G]10/09/2020, 3:32 PM