Maps:to_list/1 element order.

Valentin Micic v@REDACTED
Fri Feb 28 12:20:13 CET 2020


Thanks.

> On 28 Feb 2020, at 11:58, Łukasz Niemier <lukasz@REDACTED> wrote:
> 
>> Returns a list of pairs representing the key-value associations of Map, where the pairs [{K1,V1}, ..., {Kn,Vn}] are returned in arbitrary order.
>> 
>> It appears that the list returned has been sorted in ascending order, using value of the key as a criterion for sorting.
> 
> „Sorted” is special case of „arbitrary order”. Also this is only case in case of maps with less than 32 keys which are stored as 2 sorted tuples. Over that limit the map is stored as a hash map which will cause more „arbitrary ordering”.
> 
> --
> 
> Łukasz Niemier
> lukasz@REDACTED <mailto:lukasz@REDACTED>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200228/729e85ae/attachment.htm>


More information about the erlang-questions mailing list