Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map keys not sorted #139

Closed
AZQ1994 opened this issue Jul 12, 2023 · 0 comments · Fixed by #144
Closed

Map keys not sorted #139

AZQ1994 opened this issue Jul 12, 2023 · 0 comments · Fixed by #144

Comments

@AZQ1994
Copy link
Contributor

AZQ1994 commented Jul 12, 2023

Issue description

Elixir Map changes from sorted map to hashed map when size is over 32.
Current implementation does not sort the keys so it becomes messy with a huge map.

iex(3)> (1..32) |> Map.new(&{&1, &1}) |> Ymlr.document!()
"---\n1: 1\n2: 2\n3: 3\n4: 4\n5: 5\n6: 6\n7: 7\n8: 8\n9: 9\n10: 10\n11: 11\n12: 12\n13: 13\n14: 14\n15: 15\n16: 16\n17: 17\n18: 18\n19: 19\n20: 20\n21: 21\n22: 22\n23: 23\n24: 24\n25: 25\n26: 26\n27: 27\n28: 28\n29: 29\n30: 30\n31: 31\n32: 32\n"
iex(4)> (1..33) |> Map.new(&{&1, &1}) |> Ymlr.document!()
"---\n33: 33\n12: 12\n23: 23\n29: 29\n30: 30\n26: 26\n31: 31\n11: 11\n9: 9\n32: 32\n25: 25\n28: 28\n6: 6\n13: 13\n20: 20\n15: 15\n14: 14\n2: 2\n7: 7\n1: 1\n8: 8\n3: 3\n17: 17\n22: 22\n21: 21\n4: 4\n24: 24\n10: 10\n27: 27\n19: 19\n5: 5\n18: 18\n16: 16\n"
@AZQ1994 AZQ1994 mentioned this issue Jul 18, 2023
3 tasks
@mruoss mruoss linked a pull request Jul 26, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant