title: Why Elixir's MapSet becomes unordered after 32 elements?
body: <pre><code>iex&gt; MapSet.new(1..32) |&gt; Enum.to_list
  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
   23, 24, 25, 26, 27, 28, 29, 30, 31, 32]
  
  iex&gt; MapSet.new(1..33) |&gt; Enum.to_list
  [11, 26, 15, 20, 17, 25, 13, 8, 7, 1, 32, 3, 6, 2, 33, 10, 9, 19, 14, 5, 18, 31,
   22, 29, 21, 27, 24, 30, 23, 28, 16, 4, 12]
  </code></pre>
  
  <p>Here's the <a href="https://github.com/elixir-lang/elixir/blob/v1.3.0/lib/elixir/lib/map_set.ex#L69">implementation</a> in Elixir 1.3</p>
  
  <pre><code>def new(enumerable) do
    map =
      enumerable
      |&gt; Enum.to_list
      |&gt; do_new([])
  
    %MapSet{map: map}
  end
  
  defp do_new([], acc) do
    acc
    |&gt; :lists.reverse
    |&gt; :maps.from_list
  end
  
  defp do_new([item | rest], acc) do
    do_new(rest, [{item, true} | acc])
  end
  </code></pre>
  
  <p>Even though the order doesn't matter in a <code>MapSet</code>, but still wondering why a <code>MapSet</code> becomes unordered after 32 elements?  </p>